Restore original package configuration files in Ubuntu
While test-driving Ansible playbooks and configuring packages, I overwrite default configurations. Sometimes I want to recover the default settings, this is a quick reminder to myself on how to do this.
Find the package
$ dpkg -S /etc/dspam/dspam.conf
dspam: /etc/dspam/dspam.conf
The package using /etc/dspam/dspam.conf
is dspam
.
Remove the config file you want to restore
$ sudo rm /etc/dspam/dspam.conf
Or you might want to rename it:
$ sudo mv /etc/dspam/dspam.conf /tmp/dspam.conf.bak
Restore the original configuration file(s)
$ sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall dspam
Configuration file `/etc/dspam/dspam.conf`, does not exist on system.
Installing new config file as you requested.
Thanks for reading
Feel free to leave a comment if you have remarks or like this post