Craig Box's journeys, stories and notes...

Shutting Debconf up

Debian's package system, as well as its automatic dependency resolution, has reasonable management of configuration files - not as great as Gentoo, unfortunately, which has some smarts about merging changes, but at least it stops you and tells you what is changing. It does this for files that are labelled as 'conffiles'.

If you're upgrading a lot of alike machines, you can find out what answers you want to load in first, and then tell the others to accept or reject the changes appropriately.

For example, hdparm gets an init script in Dapper that it didn't have in Hoary, so we can safely force an answer of 'yes' for that package:

apt-get install -y hdparm -o Dpkg::Options::="--force-confnew"

However, the firewall rules have been customized locally, and overwriting them with defaults would be bad!

apt-get install -y linuxserver-firewall -o Dpkg::Options::="--force-confold"

ClamAV's packages are a bit smarter, using the newer ucf configuration system, which, among other things, can handle a three way merge - letting you compare new, current and original, in a way that can roll your changes in a bit better. (It's also designed more for files edited or created in postinst, and not just plain configuration files). The syntax for automatic accepting of conffile changes is different for UCF:

UCF_FORCE_CONFFOLD=yes apt-get install -y clamav-base

Look at 'man ucf' and 'man dpkg' for more force options.

Tags: , , ,

Leave a Reply