0

When I'm updating a package and a new configuration file is shipped, I'm asked whether I want to keep my version, install the new one or view the differences.

As I have to document an older server, I'd like to start by explaining what I did (and why), how can I get a list of changes to local config files?

1 Answer 1

2

I think that apt isn't able to produce such a list, per se. The question apt seems to prompt for is based on the results of dpkg that knows what files are going to be updated and checking those files for local changes (how, I don't know).

The downside of using only those changes in e.g. documenting a server is, that it only reports changes made to actual and original config files from packages (usually in /etc/.../<prog>.conf), not users' personal configs (~/.<prog>.conf) or such a packages that use overridable config files (<prog>.conf vs. <prog>.conf_master).

Disclaimer: I haven't dug into the deep internals of apt or dpkg so I might very well have gotten some detail wrong. Corrections are welcome.

A few tips still to ease the preparations for similar situations in the future:

  • There is a program called etckeeper that is specifically designed to track changes to configuration files in /etc/. It basically keep all files in VCS, enhanced with permission and metadata tracking. Tracking is hooked into various packet management systems so that any new or removed packages trigger the configuration to be saved.

    Naturally, this won't help in your situation, where and if etckeeper isn't already installed and tracking changes to the environment right from the start.

  • dpkg-changes is a perl script to track changes in installed/removed packages, but it doesn't keep a log of individual files introduced by those packages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .