Reinstall original configuration file from package

1. Find out what package installed the config file:

$ dpkg -S unity-greeter.conf
  unity-greeter: /etc/lightdm/unity-greeter.conf

As you can see, the name of the package is unity-greeter.

2. Rename (or delete) the config file you wish to restore:

sudo mv -i /etc/lightdm/unity-greeter.conf /etc/lightdm/unity-greeter.conf.bak

3. Run the following command, replacing <package-name> with the name of the package:

sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall <package-name>

4. If everything worked as expected, you should get this message:

Configuration file `/etc/lightdm/unity-greeter.conf', does not exist on system. Installing new config file as you requested.

A Practical example when needing to reinstall all of the PulseAudio configuration files:

apt-cache pkgnames pulse |xargs -n 1 apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall
/var/customers/webs/cw01/wiki/data/pages/debian/reinstall_config_from_package.txt · Last modified: 2016/07/08 09:21 by wadmin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki