Debconf in Debian Packages- 3 mins
As part of my GSoC project, I had to find a way to ask users questions and install the packages depending on their given answers, my specific case was to ask the users to select an entry from multiple choices and download an archive from the chosen one, to achieve this, I used debconf.
So what is debconf ?
Debconf is a backend database, with a frontend that talks to it and presents an interface to the user. There can be many different types of frontends, from plain text to a web frontend. The frontend also talks to a special config script in the control section of a Debian package, and it can talk to postinst scripts and other scripts as well, all using a special protocol. These scripts tell the frontend what values they need from the database, and the frontend asks the user questions to get those values if they aren’t set.
Even better, we can make sure that the users get the questions in their own languages by using
debian/templatesfile. An underscore before a field name indicates that this field is translatable. Example:
- Create debian/config file (
packagename/somthingis the same as in
- Create the folder
- Create the file
- Generate the
- Get and use the result (in
debian/postinitfor example with the variable
- We can purge the database when purging the package with the command
- Finaly, We can add the entry