Reputation: 446
I'm trying to create an script to install a LAMP server automatically and unatended in debian.
The thing is that I realized that debconf-set-selections seems to be not working with phpmyadmin.
In fact, if I run..
debconf-get-selections | grep phpmyadmin
..it doesn't return anything and it's supposed to return the available options that you can choose and use.
Is it possible that in the last versions of debconf phpmyadmin is not available?
This is my code and it does nothing.. I mean, it still asks for the options:
def installPHPMyAdmin():
subprocess.call("debconf-set-selections <<< " +
"\"phpmyadmin phpmyadmin/dbconfig-install boolean true\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/mysql/admin-pass " +
"password " + mysqlPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/mysql/app-pass " +
"password " + phpMyAdminPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/app-password-confirm " +
"password " + phpMyAdminPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/reconfigure-webserver " +
"multiselect none\"")
return subprocess.call("apt-get install -y phpmyadmin")
Upvotes: 0
Views: 1518
Reputation: 1292
Debconf (the tool, not the conference ;) ) is a system which allows package maintainers to write a configuration script that allows the sysadmin to configure many parts of the system, with an exchangeable UI. the architecture is such that answers to questions are stored in a 'database' (actually a set of files) so that if the package gets upgraded, questions which have been answered before don't get repeated.
debconf-get-selections
is a tool which allows a system administrator to query that database; however, for it to return something, there has to be something in the database on the system where you run it, first. If you haven't configured phpmyadmin on your system, the database will be empty.
To fix, run the following:
dpkg-reconfigure -p low phpmyadmin
This will ask all questions the system has for phpmyadmin, and configure things for you.
Upvotes: 1