Score:1

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

pk flag

I'm running on Ubuntu 20.04 on Circle CI "machine" executor. 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

I'm not using "--force-yes". Where is this coming from? Even

sudo apt-get update

throws the same warning.

mforsetti avatar
tz flag
Did you have `APT::Get::force-yes "true"` set in your `/etc/apt/apt.conf` or in any files in `/etc/apt/apt.conf.d/`?
pk flag
@mforsetti - that is it! Please add an answer saying that. Here is the relevant section from apt.conf: // Auto "-y" for apt-get APT { Get { Assume-Yes "true"; force-yes "true"; }; };
Score:4
tz flag

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.

pk flag
Yes, I’m going to have to let Circle CI know about this problem with their images. In the mean time, I am just removing the force=yes part of the config file as a part of my job. Thanks for the answer.
Score:0
mx flag

The first answer is right, but I could not understand from that what should be written instead of --force-yes. In my code, it was:

--allow-change-held-packages 

This is taken from a comment below much of the same question at Ubuntu 18 command apt-get dist-upgrade -qq --force-yes deprecated - Super User.

This is tested, the warning "W: --force-yes is deprecated, use one of the options starting with --allow instead" vanished. If this does not help, check the link for other --allow-... strings.

pk flag
I don't believe you need to replace it, just remove it.
questionto42standswithUkraine avatar
@KevinBuchs Good guess, strange wording then. I will not take the time to test it, anyone else who does so may comment.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.