Tool for merging conf files in /etc during upgrade?

Solution 1:

While upgrading via apt-get, one usually gets a prompt of what to do with the config file (Install new version, Keep the old version, etc).

If we choose to keep the current version, the new config files get stored with an extension (.dpkg-dist).

The following command can be used to list the new files:

find /etc -type f -name "*.dpkg-dist"

And to take action on these config files, we can use the provided ucf tool. Its syntax is:

ucf <new-file> <old-file>

For example,

ucf /etc/sysctl.conf.dpkg-dist /etc/sysctl.conf

See also,

https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/