apt-key is deprecated

35,754

Solution 1

The answer is in the notice: Manage keyring files in trusted.gpg.d instead

So

cd /etc/apt/trusted.gpg.d/
rm {file}

where {file} needs to be replaced by the filename (7D8D08F6?) you want removed.

Solution 2

You first need to find the keychain where the key with id 7D8D08F6 is stored:

for f in /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/*.{asc,gpg}; do
  $(gpg --list-keys --keyid-format short --no-default-keyring --keyring $f | fgrep -iq 7D8D08F6) && echo "Key 7D8D08F6 in $f"
done

and then delete this keyring:

sudo rm /etc/apt/trusted.gpg.d/<KEYRING>.gpg
Share:
35,754

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    i want to remove a repository but every time i get the error "Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))." ive tried updating apt-key and apt-get just to be sure but didnt solve the problem. please help.

    like this command $ sudo apt-key del 7D8D08F6 .

  • Hrobky
    Hrobky over 3 years
    Important: User gpg with absolute paths as shown in the example. Otherwise keyrings would be searched in your ~/.gnupg directory.
  • Csabi Vidó
    Csabi Vidó about 3 years
    Could you please check? This information is probably outdated or misleading. I found this here. Moritz Bunkus (mkvtoolnix) also updated his repositories with these new instructions, he is usually quick and careful. Using signed-by= for each repo makes sense. Cloud-Init still uses apt-key though.