2

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?

2 Answers 2

1

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:

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

1

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 http://bit.ly/software-small, 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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