The Debconf User's Guide

Joey Hess

The Debian Project

joeyh@debian.org

This text is copyright by the author under the terms of the BSD license, sans advertising clause.


Table of Contents
Introduction
Preconfiguring packages
Reconfiguring a package
Frontends
Priorities
Backend Database

Introduction

This is a guide to debconf, from the user's perspective. [1] Debconf is the new user interface that is popping up in increasing numbers of packages as you install them with dpkg. It provides a consistent interface to configuring packages, and lets you do some neat things you couldn't before. This guide will show you some of them. But best of all, it ensures that you only see each question once, not over and over each time you install a package, like you might have in the past.


Reporting Bugs

But first, please realize that debconf is still under development. I introduce new bugs from time to time. If debconf is misbehaving, please check the debconf bug list before filing a bug. You might also try the latest version of debconf in Incoming, as I have often seen and fixed the bug before you encounter it. Please try to keep my workload down by not filing duplicate bug reports.

If you do file a bug report, tell me the frontend you were using when the problem occurred, what you did to trigger the problem, and paste any error messages you can into the bug report.

Before you report a bug, it is a good idea to enable some debugging output, which might indicate what the problem is. Debconf looks at the DEBCONF_DEBUG environment variable to determine what kinds of debugging information to display. You may find it useful to set DEBCONF_DEBUG to 'user' (and export it), which will make debconf display user-level debug information. Other settings include 'developer', which outputs debug information nore suited to Debian developers, and 'debug', which outputs information useful for debugging debconf itself. DEBCONF_DEBUG is actually treated as a regulr expression, so it can be set to '.*' to make all debugging information be shown.


Preconfiguring packages

Debconf can configure packages before they are even installed onto your system. This is useful because it lets all the questions the packages are going to ask be asked at the beginning of an install, so the rest of the install can proceeed while you are away getting a cup of coffee.

If you use apt (version 0.5 or above), and you have apt-utils installed, pre-configuration will be done to all packages apt installs. This is controlled via /etc/apt/apt.conf.d/70debconf.

Sometimes you might want to preconfigure a package by hand, when you're not installing it with apt. You can use the dpkg-preconfigure command to do that, just pass it the filenames of the packages you want to preconfigure. You will need apt-utils installed for that to work.


Reconfiguring a package

One of the first things you will probably want to use debconf for is to reconfigure a package. You installed the package, and answered debconf's questions, but now that you've used it a while, you realize you want to go back and change some of your answers. In the past, reinstalling a package was often the thing to do when you got in this situation, but when you reinstall the package, debconf seem to remember you have answered the questions, and doesn't ask them again.

Luckily, debconf makes it easy to reconfigure any package that uses it. Suppose you want to reconfigure debconf itself. Just run, as root:

dpkg-reconfigure debconf

This will ask all the questions you saw when debconf was first installed. It may ask you other questions as well, since it asks even low priority questions that may have been skipped when the package was installed. You can use it on any other package that uses debconf, as well.


Frontends

One of Debconf's unique features is that the interface it presents to you is only one of many, that can be swapped in at will.

Table 1. Debconf frontends

frontend description
slang This frontend is based on the Slang toolkit. It presents a full-featured GUI (in text mode). Note that for this frontend to work, you must have the libterm-stool-perl package installed.
dialog This uses the whiptail or dialog programs to display questions to you. It works in text mode.
text The most traditional frontend, this looks quite similar to how Debian configuration always has been: a series of questions, printed out at the console using plain text. It includes readline support, and even supports tab completion.

Note: I reccommend you install the libterm-readline-gnu-perl package to make the most of the readline support. It will even let you back up to a previous question via ctrl-U or Page Up.

Note: This frontend has some special hotkeys. Pageup (or ctrl-u) will go back to the previous question (if that is supported by the package that is using debconf), and pagedown (or ctrl-v) will skip forward to the next question.

This is the best frontend for remote admin work over a slow connection, or for people who are comfortable with unix.
noninteractive This is the anti-frontend. It never interacts with you at all, and makes the default answers be used for all questions. It will occasionally mail root with messages the package wanted to display, but that's it; otherwise it is completly silent and unobtrusive, a perfect frontend for automatic installs.
editor This is for those fanatics who have to do everything in a text editor. It runs the your editor on a file that looks something like typical unix config file, and you edit the file to communicate with debconf. Debconf's author takes the fifth amendment regarding the circumstances that lead to this frontend being written.
web This frontend acts as a web server, that you connect to with your web browser, to browse the questions and anser them. It has a lot of promise, but is a little rough so far. When this frontend starts up, it will print out the location you should point your web browser to. You have to run the web browser on the same machine you are configuring, for security reasons.

Note: Do keep in mind that this is not a very secure frontend. Anyone who has access to the computer being configured can currently access the web server and configure things while this frontend is running. So this is more of a proof of concept than anything.



You can change the default frontend debconf uses by reconfiguring debconf. On the other hand, if you just want to change the frontend for a minute, you can set the DEBIAN_FRONTEND environment variable to the name of the frontend to use. For example:

DEBIAN_FRONTEND=text apt-get install slrn

The dpkg-reconfigure and dpkg-preconfigure commands also let you pass --frontend= to them, followed by the frontend you want them to use.


Priorities

Another nice feature of debconf is that the questions it asks you are prioritized. If you don't want to be bothered about every little thing, you can set up debconf to only ask you the most important questions. On the other hand, if you are a control freak, you can make it show you all questions. Each question has a priority, from this list:

Table 2. Supported priorities

Priority Description
low Very trivial items that have defaults that will work in the vast majority of cases.
medium Normal items that have reasonable defaults.
high Items that don't have a reasonable default.
critical Items that will probably break the system without user intervention.


Only questions with a priority equal to or greater than the priority you choose will be shown to you. You can set the priority value by reconfiguring debconf, or temporarily by passing --priority= followed by the value to the dpkg-reconfigure and dpkg-preconfigure commands or by setting the DEBIAN_PRIORITY environment variable.


Backend Database

Debconf uses a rather flexible and potentially complicated backend database for storing data such as the answers to questions. The file /etc/debconf.conf is used to configure this database. If you need to set up something complicated, like make debconf read a remote database to get defaults, with local overrides, read the debconf.conf(5) man page for all the gory details.

Notes

[1]

For a quick introduction to debconf, see the Introduction to Debconf. For more detailed information about using debconf with packages, see the Debconf Tutorial.