dpkg-reconfigure is a powerful command line tool used to reconfigure an already installed package. It is one of the several tools offered under dpkg – the core package management system on Debian/Ubuntu Linux. It works in conjunction with debconf, the configuration system for Debian packages. Debconf registers the configuration of all installed packages on your system.


View Configurations Of Installed Package


To view current configurations of an installed package “phpmyadmin“, use the debconf-show utility as shown.

$ sudo debconf-show phpmyadmin


Reconfigure Installed Package in Debian and Ubuntu


If you have already installed a package, for instance phpmyadmin, you can reconfigure it by passing the package name to dpkg-reconfigure as shown.

$ sudo dpkg-reconfigure phpmyadmin


Once you have run the command above, you should be able to start reconfiguring phpmyadmin as shown in the following screenshot. You will be asked a series of questions, select the settings you want and complete the process.



Configure Web Server for PhpMyAdmin

When the phpmyadmin reconfiguration process is done, you will see some useful information concerning the new package settings.


There are some useful options which allow you to change its default behaviour, we will explain some of the practically useful ones, as follows.


The -f flag is used to choose the frontend (such as dialogue, readline, Gnome, Kde, Editor or noninteractive) to use.

$ sudo dpkg-reconfigure -f readline phpmyadmin


You can permanently change the default frontend via the debconf, by running the following command.

$ sudo dpkg-reconfigure debconf


Use the Up and Down keys to select an option, and press the TAB key to choose Ok and press Enter. 


Change dpkg-reconfigure Frontend


Also choose which questions to ignore according to priority level, as shown in the screenshot and press Enter.


Change Debconf Priority


To specify the minimum priority of questions that will be displayed, directly from the command line, use the -p option.

$ sudo dpkg-reconfigure -p critical phpmyadmin


Some packages may be in an inconsistent or broken state, in such a case, you can use the -f flag to force dpkg-reconfigure to reconfigure a package. Remember to use this flag with caution!

$ sudo dpkg-reconfigure -f package_name


For more information, see the dpkg-reconfigure man page.

$ man dpkg-reconfigure
Was this answer helpful? 1 Users Found This Useful (2 Votes)