I just upgraded from Ubuntu 21.10 to 22.04.
sudo apt update
ends with the following warnings...
W: https://linux.teamviewer.com/deb/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://apt.keepsolid.com/ubuntu/dists/groovy/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://linux.dropbox.com/ubuntu/dists/disco/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://download.virtualbox.org/virtualbox/debian/dists/hirsute/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://download.opensuse.org/repositories/home:/IBBoard:/cawbird/xUbuntu_22.04/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://ppa.launchpad.net/solaar-unifying/stable/ubuntu/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.
W: http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/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.
W: http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/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.
Synaptic
shows the same warnings on a reload.
Reviewing man apt-key
doesn't clarify this for me.
I think this is because Ubuntu 22.04 has transitioned from using /etc/apt/trusted.gpg to using individual .gpg files located in /etc/apt/trusted.gpg.d.
Can these keys be converted from one to the other, or must I delete these keys and reimport them?
The easy way to fix these warning messages generated by
sudo apt update
...Note: These warning messages can be generated by any enabled repo or ppa in
Software & Updates
"Other Software" tab.Example fix:
For this warning message with
sudo apt update
...We look in
sudo apt-key list
and find this entry for xbmc...Then we convert this entry to a .gpg file, using the last 8 numeric characters from above...
Repeat the above commands for each warning message generated by
sudo apt update
.Note: Partially taken from the accepted answers here and here.
Came across this problem after moving to 22.04 and wanted to add my solution. I had a lot of keys that needed to be updated/converted. This is not an optimal solution, but works well.
A one-liner to convert all deprecated keys to the new format.
PLEASE TAKE THE TIME TO UNDERSTAND WHAT YOUR DOING HERE BEFORE RUNNING IT!! Also make sure your bash is not too old. My bash version:
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Explanation:
Now we have a collection of key suffixes, each 8 characters in length.
KEY
variable.K
K
and pass/pipe it togpg
to properly store it.Special thanks to heynnema whose solution is at the core of this.
What worked for me was:
I've turned @heynnema's answer into a function, which you can place under
.bashrc
for convenience. This takes two arguments: the key (last 8 characters) and the destination filename for the output GPG file.Example:
apt-key-migrate 91E7EE5E team-xbmc
apt-key is deprecated and shall be replaced on the long run on Ubuntu 22.04.
When you need it, you may delete existing key with:
and
Import your key with command like:
Add the signature to /etc/apt/sources.list.d/your.list
More details on the manual:
link
Good details here as well: link
I modified the @Frank's function to remove the key from the legacy trusted.gpg to avoid duplication.