apt-key¶
from man apt-key:
DEPRECATION
Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This
section shows how to replace existing use of apt-key.
If your existing use of apt-key add looks like this:
wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -
Then you can directly replace this with (though note the recommendation below):
wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc
Make sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the
binary OpenPGP format (also known as "GPG key public ring"). The binary OpenPGP format works
for all apt versions, while the ASCII armored format works for apt version >= 1.4.
i.e.
W: http://raspbian.raspberrypi.org/raspbian/dists/bookworm/InRelease:
Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg),
see the DEPRECATION section in apt-key(8) for details.
Solution:
- Remove keys from
/etc/apt/trusted.gpg - Add
[signed-by=/usr/share/keyrings/raspbian-archive-keyring.gpg]to/etc/apt/sources.list