apt-get key deprecation
April 28, 2022

apt-get key deprecation

Posted on April 28, 2022  •  1 minutes  • 106 words  •  Suggest Changes

Got this small annoying “error” while running apt-get update. Seems that apt-key is deprecated;

W: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

This is the quick and dirty way :

mv  /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/

A better solution is described here, on askubuntu

$key = key you wish to transfer to new systemn check with apt-key list. $keyname = name you can choose

# export key
apt-key export $key

# import back into file format
gpg --dearmour -o /usr/share/keyrings/$keyname.gpg

# change repo file
deb [arch=amd64 signed-by=/usr/share/keyrings/$keyname.gpg] stable main

# delete key
apt-key del $key

img by jack_1


If you enjoyed this website, consider buying me a Dr. Pepper

Buy me a Dr PepperBuy me a Dr Pepper