If you have used the debconf-set-selections command that I mentioned in a previous article there will likely be more questions that come up over time such as how to view variables that have been set for specific packages or how to flush the debconf database. Below I show a couple example that explain how to view variables in the debconf database and also how to remove those variables from the database.
Show Variables For A Specific Package In The Ubuntu debconf Database:
- root@ubuntu-dev:~# debconf-show mysql-server
- * mysql-server/root_password_again: PASSWORD
- * mysql-server/root_password: PASSWORD
- root@ubuntu-dev:~#
In the above example you can see that we are showing all of the debconf variables set for the mysql-server package. Now if you wanted to flush all variables for the mysql-server package from the debconf database you would use the below command.
Flush All Variables For A Specific Package From The debconf Database:
- root@ubuntu-dev:~# echo PURGE | debconf-communicate mysql-server
- 0
- root@ubuntu-dev:~#
To verify that there are no longer any debconf variables set for mysql-server use the same command displayed above.
Verify debconf Variables Removed For A Specific Package On Ubuntu:
- root@ubuntu-dev:~# debconf-show mysql-server
- 0
- root@ubuntu-dev:~#
Thats it… debconf rocks.
when I # debconf-show mysql-server-5.5
* mysql-server/root_password: (password omitted)
* mysql-server/root_password_again: (password omitted)
I would like to use the password in a script to setup other software that uses mysql.
If used in the same script is the password omitted?