Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg)

6,229

Solution 1

The easy way to fix these warning messages generated by sudo apt update...

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.

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...

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.

We look in sudo apt-key list and find this entry for xbmc...

pub   rsa1024 2009-01-20 [SC]
      1897 01DA 570C 56B9 488E  F60A 6D97 5C47 91E7 EE5E
uid           [ unknown] Launchpad PPA for XBMC for Linux

Then we convert this entry to a .gpg file, using the last 8 numeric characters from above...

sudo apt-key export 91E7EE5E | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/team-xbmc.gpg

Repeat the above commands for each warning message generated by sudo apt update.

Note: Partially taken from the accepted answers here and here.

Solution 2

What worked for me was:

mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/
Share:
6,229
Boris Hamanov
Author by

Boris Hamanov

Former DEC Hardware Engineer, DEC Field Service Manager, and DEC VAX/VMS System Manager, but mostly a Computer Hardware Service Manager. Have worked for Digital Equipment Corporation, Computerland, Sony, Computerware, Executron Computers, CompUSA, and Apple Computer. Hardware, software, and management savvy.

Updated on January 04, 2023

Comments

  • Boris Hamanov
    Boris Hamanov over 1 year

    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?

    • Admin
      Admin almost 2 years
    • Admin
      Admin almost 2 years
      @ChanganAuto Thanks for the lead! It's a lot to digest. Don't know why the upgrade didn't take care of that for me... it's going to cause problems for a lot of users.
    • Admin
      Admin almost 2 years
      Does this answer your question? apt-key deprecation warning when updating system
    • Admin
      Admin almost 2 years
      @starbeamrainbowlabs Thanks for the lead! Please see my simplified answer, below.
    • Admin
      Admin almost 2 years
      @ChanganAuto Please see my simplified answer, below.
    • Admin
      Admin almost 2 years
      Great job. +1 (should be more)
  • Admin
    Admin almost 2 years
    That's the answer i was looking for. Thanks!
  • Admin
    Admin almost 2 years
    My answer is much easier. It doesn't require any deletions, curls, and any .list file edits.
  • Admin
    Admin almost 2 years
    Awesome. This worked for me. Is there any reason to delete the key from the legacy system?
  • Admin
    Admin almost 2 years
    @lindhe That's optional. I haven't on my system. No problem.
  • Admin
    Admin almost 2 years
    I tried different way to achieve this, and this is the easier way. I got a warning (Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).), but the .gpg file was created.