0

This is a follow up to silencing the warnings of apt-key.

When I have legacy and deprecated keys installed, I see warnings on

When I install anything using apt-get or simply just update via:

apt-get update -qq > /dev/null

I see warnings about legacy keys:


W: http://packages.icinga.com/ubuntu/dists/icinga-jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://deb.goaccess.io/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

I am aware of the security concerns. For my use case, I simply do not want to spam the console. I want to hide these warnings yet erros should still be shown.

How can I achieve that? (I don't want to move keys or import them the "right" way.)


APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE does not apply when apt-get update is executed as I tried

APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-get update -qq > /dev/null`

yet warnings are still shown.

muru
  • 207,228
k0pernikus
  • 6,336

1 Answers1

0

I went with moving the keys to /etc/apt/trusted.gpg.d/ folder; since I am using the command in a bash init script, I check its existence, and only if it exists, I will move it:

[ ! -f /etc/apt/trusted.gpg ] || mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/

Now no warnings will be shown:

apt-get update -qq > /dev/null

Of course, the security risks are still present.

k0pernikus
  • 6,336