debconf-set-selections
Pre-configure Debian package installation questions
SYNOPSIS
debconf-set-selections [options] [filename...]
PARAMETERS
filename...
One or more files containing Debconf selections to process. If no filename is provided, selections are read from standard input.
-c, --check-input
Check the syntax of the input file(s) without actually setting any selections. Useful for validating preseed files.
-v, --verbose
Produce more verbose output, showing what selections are being processed.
-h, --help
Display a help message and exit.
--merge-missing
Only set values if they are not already present in the Debconf database. Existing values will not be overwritten. By default, existing values are overwritten.
DESCRIPTION
debconf-set-selections is a utility used to populate the Debconf database with answers to questions that Debian packages ask during installation or configuration. Debconf is the configuration management system for Debian packages, designed to allow packages to ask questions and get answers consistently. This command is crucial for automating package installations, especially in unattended environments like server deployments or customized Debian/Ubuntu installations.
Instead of requiring a user to interactively answer Debconf questions, debconf-set-selections allows these answers to be provided beforehand from a file or standard input. This "pre-seeding" of answers ensures that package installations proceed without interruption, using the specified default values. It's commonly used with the Debian installer's "preseed.cfg" file or in scripts for configuring a system after base installation. The selections are stored in the Debconf database, which packages then query when they run their configuration scripts via dpkg or apt.
CAVEATS
The selections set by debconf-set-selections are stored in the Debconf database but do not automatically reconfigure packages that are already installed. To apply new selections to an already installed package, you often need to run dpkg-reconfigure <package_name>.
If selections are provided via multiple files or stdin, the order matters. Later entries for the same question will overwrite earlier ones, unless --merge-missing is used.
This command sets Debconf selections. It does not configure other system aspects (e.g., network, users) which might also be part of an unattended installation process.
Input files should be trusted, as malicious input could potentially lead to unexpected package configurations.
<B>INPUT FILE FORMAT</B>
The input file for debconf-set-selections uses a specific format, typically one selection per line:
package_name question_name type value
For example:
tzdata tzdata/Areas select Europe
apache2 apache2/port string 8080
Comments can be added using '#' at the beginning of a line.
<B>USAGE WITH DPKG-RECONFIGURE</B>
It's important to understand that debconf-set-selections only populates the Debconf database. For packages that are already installed, their configuration scripts won't automatically re-run. To force a package to re-read its configuration from the Debconf database and apply changes, you must explicitly run dpkg-reconfigure <package_name> (or dpkg-reconfigure -a for all installed packages).
<B>UNATTENDED INSTALLATIONS AND PRESEEDING</B>
This command is fundamental for creating unattended Debian or Ubuntu installations. A 'preseed.cfg' file, containing a list of Debconf selections, is passed to the installer, which then uses debconf-set-selections internally (or a similar mechanism) to populate the database before packages are installed, ensuring a fully automated setup.
HISTORY
debconf-set-selections is an integral part of the Debconf system, which was introduced in Debian around late 1999/early 2000. It quickly became the standard method for managing package configuration questions, replacing older, less structured methods. This command's development paralleled the growth of automated and unattended Debian/Ubuntu installations, particularly with the rise of the Debian installer's "preseed" functionality, making it a cornerstone utility for system administrators and developers creating reproducible environments.
SEE ALSO
debconf(7), dpkg-reconfigure(8), dpkg(8), apt(8), preseed(7)