I have a server running Ubuntu and a program which was installed with apt-get install and I'd like to see the unmodified config file (e.g. /etc/foo/foo.cfg) so that I can diff it against the current version to see what modifications were made. Is there an easy way to do this, perhaps with some sort of apt command?

link|improve this question

75% accept rate
feedback

2 Answers

up vote 1 down vote accepted

As far as I know you can only achieve this if you still have the original .deb around, but most of the time a similar one should be enough.

I think this superuser.com link answers this question more thoroughly than I could:

http://superuser.com/questions/69045/how-do-i-get-the-default-configuration-from-a-deb-file

link|improve this answer
feedback

apt-get doesn't store the original version of the configuration file. You can redownload the original package.

As a preventative measure, install etckeeper Install etckeeper, which is a seamless way of having version control in /etc. Once you've installed the package, edit /etc/etckeeper/etckeeper.conf to select your favorite version control software (the default is Bazaar, you can use Darcs, Git or Mercury instead), then run etckeeper init. You won't have to interact with etckeeper again unless you want to. You can run etckeeper commit manually after you've made a change, but if you don't apt will automatically make a commit before and after each package installation run. Use the VCS's commands (log, diff, annotate, …) to look at change histories and revert to older versions.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.