apt-get --force-yes: How to suppress further questions

Solution 1:

Try:

export DEBIAN_FRONTEND=noninteractive
apt-get -y install package1 package2

Solution 2:

Another solution: use yes command to blindly answer yes to all questions.

Apt is smart enough that this solution isn't recommended unless:

  1. you know what you're doing, and

  2. the -y and --force-yes options don't do what you want

In my case, I want to downgrade Nginx, and I don't care about the dependencies. For some reason force-yes didn't work, nor did the DEBIAN_FRONTEND=noninteractive environment variable.

Here's how to downgrade a package noninteractively:

yes | apt install nginx-common=1.4.6-1ubuntu3.3 nginx-full=1.4.6-1ubuntu3.3