Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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