So, in order to prevent console-UI (newt, snack, dialog) prompts during the dpkg post-install, you have to do something like:
debconf-set-selections <<< 'mysql-server mysql-server/root_password password password'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password verify_password'
apt-get -y install mysql-server
- Is there a rule for this?
- How do we discover the prompt names/descriptors for other packages that invoke the console UI in order to prevent them?
- Would we likely have to dig through the source-code to figure out how the prompts are invoked?
- Is there a simple way to just choose all defaults (effectively clicking on whatever the default button would be and/or taking the correct text/options)?
Thanks.
NOTE
It looks like setting this variable is the solution for taking the defaults:
DEBIAN_FRONTEND=noninteractive
This will reconfigure your package with default parameters:
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure [package name]
This will display parameters you set when installing a package:
debconf-show [package name]
This will output parameters you set when installing a package, formatted to be loaded in
debconf-set-selections
:debconf-get-selections | grep '^[package name]'
To my knowledge, you can't display parameters for packages you didn't install; and you can't display default parameters without first re-configuring your package using the
noninteractive
option. You may want to use containers for testing purpose.