1

Consider the following typescript:

# export DEBIAN_FRONTEND="noninteractive"

# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/remove-data-dir boolean true"

# echo GET mysql-community-server/remove-data-dir | debconf-communicate
0 true

# apt purge mysql-*
...

# echo GET mysql-community-server/remove-data-dir | debconf-communicate
10 mysql-community-server/remove-data-dir doesn't exist

# sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password 123456"

# sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password 123456"

# echo GET mysql-server/root_password | debconf-communicate
0 123456

# apt install mysql-server-5.6
...

# echo GET mysql-server/root_password | debconf-communicate
0

So, does debconf-set-selections does this automatically? Or it's install scripts that do this? Any other option?

x-yuri
  • 1,845
  • 1
  • 22
  • 27

1 Answers1

0

To answer my own question, packages generally purge questions owned by them when they are themselves purged. As for mysql's password, postinst script explicitly clears it after installation to avoid it staying on disk. More info here and here.

x-yuri
  • 1,845
  • 1
  • 22
  • 27