How can I programmatically skip the pink Ubuntu user prompt when using `apt-get`?

1k Views Asked by At

When installing CouchDB 2.1 on Ubuntu using the the apt-get package manager, like so:

echo "deb https://apache.bintray.com/couchdb-deb xenial main" | sudo tee -a /etc/apt/sources.list
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
apt-get update
apt-get install couchdb -y

I get a prompt screen asking if I would like to install in single node mode, or clustered mode, or if I would like to configure Couch myself. (Not a command prompt, but a pink background with a button that I have to press).

I would like to configure Couch myself, though I need to be able to programmatically skip the review screen (since I'm not running the command myself - the command is part of a script).

How can I specify to automatically specify this option when installing CouchDB 2.1 using apt-get install couchdb -y?

Alternatively, would I be forced to install CouchDB from the source if I don't want to manually press the ok button?

1

There are 1 best solutions below

0
On BEST ANSWER

The prompt you receive comes from the debconf system, to configure the package. You can pre-configure the package using debconf, so that it doesn't need to ask the questions during installation. This process is called "preseeding", and is usually done during system installs to preseed all packages on a system at once. But you can do it for a single package, too.

The documentation for preseeding of debconf can be found here.