apt-get throwing warning: "W: --force-yes is deprecated, use one of the options starting with --allow instead"

Today I see that:

sudo apt-get install -y pkg1 pkg2

is throwing this warning:

W: --force-yes is deprecated, use one of the options starting with --allow instead

One can supply arguments to apt-get in at least three ways:

  • using its specific CLI arguments, e.g. apt-get --force-yes;
  • using -o CLI arguments with Configuration Item, e.g. apt-get -o "APT::Get::force-yes=true"; or
  • using its configuration files, e.g.:
    APT {
        Get {
            force-yes "true";
        };
    };
    
    in /etc/apt/apt.conf.

If you don't see set arguments specified in your apt-get calls, you probably want to check /etc/apt/apt.conf, /etc/apt/apt.conf.d/*, or any other sources of apt-get configuration files.

Note that --force-yes is dangerous and you may want to remove this options from your apt-get configuration files.