2

Some packages ask configuration questions when installed with apt-get. That makes life awkward when I want to install something non-interactively.

How do I find out what questions a package will ask, and provide answers automatically?

(Context: I'm installing things using configuration management tools. But this probably applies in a wider range of cases.)

Andrew
  • 1,174

1 Answers1

2

According to the apt-get man page, you can provide a config file for the package.

-c, --config-file

Configuration File. Specify a configuration file to use. The program will read the default configuration file and then this configuration file. See apt.conf(5) for syntax information.

Also note the -y option for automatically answering yes.

-y, --yes, --assume-yes

Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package or removing an essential package, occurs then apt-get will abort.

According to this thread on the ubuntu forum, you can discover the questions or pre/post scripts in the DEBIAN folder of the deb archive, modify the scripts and repackage the deb. However, another remark is that sometimes an ncurses gui is used which makes things difficult. In short, there does not seem to exist an easy solution..

mx1up
  • 206