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
apt-key list
gpg --import /etc/apt/trusted.gpg
gpg --armor --export A0DA38D0D76E8B5D638872819165938D90FDDD2E > /etc/apt/trusted.gpg.d/A0DA38D0D76E8B5D638872819165938D90FDDD2E.asc
...
rm /etc/apt/trusted.gpg
gpg --delete-keys A0DA38D0D76E8B5D638872819165938D90FDDD2E
apt-key list