Avoiding install prompts when using contrib/scripts/install_prereq in Debian/Ubuntu

Maybe it’s old news for users of Debian-like distros here, but I just solved something that’s really annoying: I couldn’t make a fully automated Asterisk installation script because one of the packages installed by the contrib/scripts/install_prereq script asks you for a configuration parameter: libvpb1 waits for you to enter your local country code.

Turns out you can pre-fill that – and any prompt a Debian package makes when installing – with the following method:

First, install the package interactively and feed the values you need;

Second, run this:

root@myhost:~# PACKAGE_NAME=libvpb1
root@myhost:~# debconf-get-selections | grep "^${PACKAGE_NAME}[[:blank:]]"
libvpb1 libvpb1/countrycode     string  55

Next time you have to run install_prereq, just feed the output from that to debconf-get-selections beforehand:

root@myhost:~/src/asterisk# echo 'libvpb1 libvpb1/countrycode string 55' | sudo debconf-set-selections -v
root@myhost:~/src/asterisk# ./contrib/scripts/install_prereq

In Ubuntu 20.04, debconf-get-selections is in the debconf-utils package.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.