Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debconf selections for phpmyadmin unattended installation with no webserver installed and no dbconfig-common

Tags:

debian

debconf

Wanting to install phpmyadmin from a bash script, I found it hard to get the right debconf selections in order not to have any web server installed/configured (using nginx, only apache2 and lighttpd available) and not have the phpmyadmin database configured with dbconfig-common, because I didn't found anything like this on Google.

Here's a complete list with debconf selections on Ubuntu 14.04 phpmyadmin 4:4.0.10-1:

debconf-get-selections | grep phpmyadmin
phpmyadmin  phpmyadmin/password-confirm password
# MySQL application password for phpmyadmin:
phpmyadmin  phpmyadmin/mysql/app-pass   password    
phpmyadmin  phpmyadmin/mysql/admin-pass password    
phpmyadmin  phpmyadmin/setup-password   password    
phpmyadmin  phpmyadmin/app-password-confirm password    
# Database type to be used by phpmyadmin:
phpmyadmin  phpmyadmin/database-type    select  mysql
# Reinstall database for phpmyadmin?
phpmyadmin  phpmyadmin/dbconfig-reinstall   boolean false
phpmyadmin  phpmyadmin/remove-error select  abort
phpmyadmin  phpmyadmin/reconfigure-webserver    multiselect 
phpmyadmin  phpmyadmin/missing-db-package-error select  abort
# Configure database for phpmyadmin with dbconfig-common?
phpmyadmin  phpmyadmin/dbconfig-install boolean false
phpmyadmin  phpmyadmin/upgrade-error    select  abort
# Perform upgrade on database for phpmyadmin with dbconfig-common?
phpmyadmin  phpmyadmin/dbconfig-upgrade boolean true
# Deconfigure database for phpmyadmin with dbconfig-common?
phpmyadmin  phpmyadmin/dbconfig-remove  boolean 
phpmyadmin  phpmyadmin/remote/port  string  
phpmyadmin  phpmyadmin/internal/skip-preseed    boolean true
# Do you want to back up the database for phpmyadmin before upgrading?
phpmyadmin  phpmyadmin/upgrade-backup   boolean true
phpmyadmin  phpmyadmin/setup-username   string  admin
# Host name of the MySQL database server for phpmyadmin:
phpmyadmin  phpmyadmin/remote/host  select  
# MySQL database name for phpmyadmin:
phpmyadmin  phpmyadmin/db/dbname    string  
phpmyadmin  phpmyadmin/mysql/admin-user string  root
phpmyadmin  phpmyadmin/install-error    select  abort
# Host running the MySQL server for phpmyadmin:
phpmyadmin  phpmyadmin/remote/newhost   string  
# MySQL username for phpmyadmin:
phpmyadmin  phpmyadmin/db/app-user  string  
# Connection method for MySQL database of phpmyadmin:
phpmyadmin  phpmyadmin/mysql/method select  unix socket
phpmyadmin  phpmyadmin/internal/reconfiguring   boolean false
# Do you want to purge the database for phpmyadmin?
phpmyadmin  phpmyadmin/purge    boolean false
phpmyadmin  phpmyadmin/passwords-do-not-match   error

Note: In order to run debconf-get-selections you'll need the debconf-utils package (on Ubuntu/Debian possibly the same on other Debian base distributions), run apt-get install debconf-utils (there's no prompt on installation for those who will do this from a script).

like image 880
Daniel Iancu Avatar asked Jun 09 '15 19:06

Daniel Iancu


2 Answers

Run as root:

APP_PASS="your-app-pwd"
ROOT_PASS="your-admin-db-pwd"
APP_DB_PASS="your-app-db-pwd"

echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/app-password-confirm password $APP_PASS" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password $ROOT_PASS" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/app-pass password $APP_DB_PASS" | debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections

apt-get install -y phpmyadmin

From: http://gercogandia.blogspot.com.ar/2012/11/automatic-unattended-install-of.html

like image 163
Eduardo Cuomo Avatar answered Sep 22 '22 23:09

Eduardo Cuomo


In order to install phpmyadmin in a script (unattended install) without installing/configuring any web server or having the phpmyadmin database configured with dbconfig-common, you'll need to configure the following selections before installing the package

phpmyadmin phpmyadmin/internal/skip-preseed boolean true
phpmyadmin phpmyadmin/reconfigure-webserver multiselect
phpmyadmin phpmyadmin/dbconfig-install boolean false

Without phpmyadmin phpmyadmin/internal/skip-preseed boolean true it will start configuring the database with dbconfig-common (no matter how phpmyadmin phpmyadmin/dbconfig-install is set). For me this was what was missing and I didn't find on Google. The rest are obvious.

You can set them like this:

debconf-set-selections <<< "phpmyadmin phpmyadmin/internal/skip-preseed boolean true"
debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect"
debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean false"

Or if this is not working:

echo "phpmyadmin phpmyadmin/internal/skip-preseed boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect" | debconf-set-selections
echo "phpmyadmin phpmyadmin/dbconfig-install boolean false" | debconf-set-selections

Then run apt-get -y install phpmyadmin.

like image 40
Daniel Iancu Avatar answered Sep 20 '22 23:09

Daniel Iancu