1

I use a Nagios test to check whether there are any packages critical updates in some Linux boxes. The check command uses the following command to look for pending critical updates: /usr/bin/apt-get -o 'Debug::NoLocking=true' -s -qq upgrade, that is exiting with a non-zero status. Therefore, the Nagios check is showing a warning.

If I run manually the command, I get the following message:

~# /usr/bin/apt-get -o 'Debug::NoLocking=true' -s -qq upgrade
E: Packages were downgraded and -y was used without --allow-downgrades.

However, I do not remember having downgraded any package. Could you please give me a hand to get rid of this warning?

Best wishes,

1 Answers1

4

“Packages were downgraded” doesn’t mean that you downgraded a package, it means that apt upgrade decided that it would need to downgrade a package (probably because you have a pin priority of 1000 or more).

The real fix is to avoid ending up in a situation where apt decides a downgrade is necessary, but I realise that that’s not the point here.

-qq implies -y, but here you also need --allow-downgrades:

apt-get -o 'Debug::NoLocking=true' -s -qq --allow-downgrades upgrade

Downgrades need additional confirmation.

(This should be avoided in general but is OK here thanks to the -s option, which asks apt to only simulate what it would do.)

Stephen Kitt
  • 434,908
  • 1
    Wow, that was an amazingly fast response. I am most grateful. It turned out that, at some time, I should have enabled the backport repository, and I upgraded the Openssl package. Therefore, on removing the backport repository from the apt sources, apt started to say that it would downgrade the Openssl package. – Jesús Ángel Mar 31 '21 at 15:35