Sometimes you may need to retrieve default settings on an installed package or reconfigure it. In this article, we will learn how to reconfigure installed package in Ubuntu/Debian Linux. In Ubuntu/Debian systems, the configuration for each package is managed in debconf, the configuration system for Debian packages. It registers the configuration for all installed packages on your system. In this article, we will learn how to reconfigure installed package in Ubuntu/Debian Linux.
How to Reconfigure Installed Package in Ubuntu/Debian Linux
Here are the steps to reconfigure installed package in Ubuntu/Debian Linux. We will use dpkg-reconfigure utility for this purpose. It works in conjunction with debconf.
1. View Configurations of Installed Packages
Let us say you want to view the configuration file of installed package phpmyadmin. Here is the command for it using debconf-show.
$ sudo debconf-show phpmyadmin
2. Reconfigure Installed Packages
You can easily reconfigure installed packages using dpkg-reconfigure. Just pass the package name to this utility.
$ sudo dpkg-reconfigure phpmyadmin
Once you enter the above command, you will see the following screen that prompts you with a series of questions to help you change the settings of your package. Here is a sample screenshot of one of the questions. Similarly, it will show a different screen for each configuration of your package.
Once the reconfiguration is over, you will see a summary of changes about your package.
3. Customize Packages
You an also use dpkg-reconfigure to change default behavior of your packages.
You can use -f flag to choose the front end of package such as dailog, readline, Gnome, Kde, Editor or noninteractive.
$ sudo dpkg-reconfigure -f readline phpmyadmin
For example, you can permanently change the front end of package with the following command.
$ sudo dpkg-reconfigure debconf
The above command will show you a dialog box with a list of available front ends on your system. Use up/down arrow keys to select an option and hit Tab key to choose Ok and press Enter.
You can also choose to ignore some of the questions you are asked during reconfiguration, if you don’t think they are important. You can do so via the following screen, that allows you to ignore questions depending on their priority level.
Alternatively, you can also set the minimum priority of questions using -p option. Mention the priority level followed by package name, after -p option.
$ sudo dpkg-reconfigure -p critical phpmyadmin
Sometimes a package may be broken or corrupted. In such cases, use -f option to force reconfigure package.
$ sudo dpkg-reconfigure -f package_name
For more information about dpkg-reconfigure use man command.
$ man dpkg-reconfigure
In this article, we have learnt how to reconfigure package in Debian/Ubuntu using dpkg-reconfigure utility. It is useful in reconfiguring a package as well as fixing a broken package, in case its configuration has gotten corrupted.