Tuesday, 24 December 2013

Force reinstall of configuration files

Some times things go wrong and you want to restore default configuration files.

This quick tip is devoted to debian based distributions

One may think that the apt-get flag - -reinstall will do the trick, however that's not enough. You'll need to provide some not-so-obvious arguments:

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

With that command the missing configuration files and missing directories will be re-deployed.

If you need to, you may want to remove the messed configuration files that you want to restore before issuing the command.