Howto use the new keystore

Feb 22, 2023

If you get a message like this, you imported you apt key in the old keystore, since apt-key is deprecated.

Schlüssel ist im veralteten Schlüsselbund trusted.gpg gespeichert (/etc/apt/trusted.gpg), siehe den Abschnitt MISSBILLIGUNG in apt-key(8) für Details.
error message

If you did something like this:

wget https://beispiel.de/key/repo-key.gpg | apt-key add -

The new way of adding key to keystore is with gpg:

wget -O- <https://beispiel.de/key/repo-key.gpg> | gpg --dearmor | sudo tee /usr/share/keyrings/<meinresporitoy>-archive-keyring.gpg

To clean everything up search for the key:

apt-key list

.
.
pub   rsa2048 2015-10-28 [SC]
      BC52 8686 B50D 79E3 39D3  721C EB3E 94AD BE12 29CF
uid        [ unbekannt] Microsoft (Release signing) <gpgsecurity@microsoft.com>
.
.
.

and the delete the old key with the fingerpring (last 8 signs)

apt-key del BE1229CF

And now the super easy way for those who read to the end :)

apt-key export BE1229CF | sudo gpg --dearmour -o /usr/share/keyrings/microsoft_keyring.gpg

apt-key del BE1229CF

Now add a tag in the source.list in front of the url:

deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft_keyring] https://packages.microsoft.com/repos/edge stable main
sudo apt update

And everything is clean now!

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.