How to check what files have been customised in /etc?

Colin Watson cjwatson at ubuntu.com
Mon Dec 14 12:23:02 UTC 2020


On Mon, Dec 14, 2020 at 12:00:13PM +0100, Tom H wrote:
> 1) Can't you compare the md5sum that's displayed by "grep-status ..."
> for a package's "<etc-file>" with the output of "md5sum
> <actual-etc-file>"?

I mean, you can, but all that tells you is that they're identical or
different.  Chris is trying to find the actual changes to the file
contents.

> 2) AFAIK, there are two categories files that are handled programmatically.
> 
> a) "/etc/nsswitch.conf" and "/etc/profile" are copied via postinst
> from "/usr/share/libc-bin/nsswitch.conf" and
> "/usr/share/base-files/profile" respectively and the latter files have
> their md5sums recorded.

There is considerable variation in how this works across various
packages (for example, sometimes the base file is a template that's
filled out according to debconf questions), which is why I didn't think
it worth mentioning separately.

> b) "/etc/hosts.allow" and "/etc/hosts.deny" are created via postinst
> with here-file statements.
> 
> I wish that the latter method were disallowed by Ubuntu (and Debian)
> packaging policies and that the copied files were recorded as owned by
> the package that installs them. It's weird that, if you run "dpkg -S
> nsswitch.conf", it returns "/usr/share/libc-bin/nsswitch.conf", and if
> you run "dpkg -S /etc/nsswitch.conf", it returns nothing. We could
> even have a new category of files,
> "/var/lib/dpkg/info/<package>.etcfiles" to record their
> existence/installation.

This has been on the dpkg wishlist since at least 2003.  It would be
great, but I gather that it is, uh, not straightforward; and in the
meantime other packages need to get things done.

-- 
Colin Watson (he/him)                              [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list