2025-03-25
How we handle debconf questions during our Ubuntu installs
In a comment on How we automate installing extra packages during
Ubuntu installs, David Magda asked how we dealt with the things that need
debconf answers. This is a good question and we have two approaches
that we use in combination. First, we have a prepared file of debconf
selections for each Ubuntu version and we feed this into
debconf-set-selections
before we start installing packages. However
in practice this file doesn't have much in it and we rarely remember
to update it (and as a result, a bunch of it is somewhat obsolete).
We generally only update this file if we discover debconf selections
where the default doesn't work in our environment.
Second, we run apt-get with a bunch of environment variables set to muzzle debconf:
export DEBCONF_TERSE=yes export DEBCONF_NOWARNINGS=yes export DEBCONF_ADMIN_EMAIL=<null address>@<our domain> export DEBIAN_FRONTEND=noninteractive
Traditionally I've considered muzzling debconf this way to be too dangerous to do during package updates or installing packages by hand. However, I consider it not so much safe as safe enough to do this during our standard install process. To put it one way, we're not starting out with a working system and potentially breaking it by letting some new or updated package pick bad defaults. Instead we're starting with a non-working system and hopefully ending up with a working one. If some package picks bad defaults and we wind up with problems, that's not much worse than we started out with and we'll fix it by updating our file of debconf selections and then redoing the install.
Also, in practice all of this gets worked out during our initial test installs of any new Ubuntu version (done on test virtual machines these days). By the time we're ready to start installing real servers with a new Ubuntu version, we've gone through most of the discovery process for debconf questions. Then the only time we're going to have problems during future system installs future is if a package update either changes the default answer for a current question (to a bad one) or adds a new question with a bad default. As far as I can remember, we haven't had either happen.
(Some of our servers need additional packages installed, which we do by hand (as mentioned), and sometimes the packages will insist on stopping to ask us questions or give us warnings. This is annoying, but so far not annoying enough to fix it by augmenting our standard debconf selections to deal with it.)