Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Last active August 2, 2023 14:07
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlessanagustin/2570c97b89c097dc12c1 to your computer and use it in GitHub Desktop.
Save carlessanagustin/2570c97b89c097dc12c1 to your computer and use it in GitHub Desktop.
For unattended installations in Debian Linux environments

Debconf: a configuration system for Debian packages

for unattended installations

Ansible module: http://docs.ansible.com/ansible/debconf_module.html

debconf-show

query the debconf database

$ debconf-show postfix
* postfix/main_mailer_type: 'Internet Site'
  postfix/chattr: false
* postfix/mailname: your.hostname.com
...

debconf-get-selections

output contents of debconf database

$ debconf-get-selections | grep postfix
postfix	postfix/mailname	string	your.hostname.com
postfix	postfix/main_mailer_type	string	'Internet Site'
...

debconf-set-selections

insert new values into the debconf database

$ echo "postfix	postfix/mailname string your.hostname.com" | debconf-set-selections
$ echo "postfix postfix/main_mailer_type string 'Internet Site'" | debconf-set-selections
$ apt-get -y install postfix

single line noninteractive

$ DEBIAN_FRONTEND=noninteractive apt-get install postfix

dpkg-reconfigure

reconfigure an already installed package

$ dpkg-reconfigure debconf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment