Setting up keys for a local repository on a new ubuntu 20.10 virtual machine, I got a message that apt-key add was deprecated and I should read the apt-key(8) man page. The apt-key(8) man page is a collection of words strung together, but if it contains information I can't winkle it out. Can anyone tell me what, exactly, I should type on my terminal instead of:
apt-key add name-of-file
The command does apparently still work after honking at me, so I was able to proceed, but would like to know what I'll need to do in the future.
Best Answer
I stumbled on the same problem and luckily some other question lighted the way. In my example I was trying to add a teamviewer repository to a recent Kali linux and I was being blocked by the key verification.
I'm quite sure there's a more elegant way to do this but the following steps helped me fix the problem:
Download the relevant key
wget -O - https://download.teamviewer.com/download/linux/signature/TeamViewer2017.asc > ~/teamviewer.key
Verify the type of file
file ~/teamviewer.key
it should be PGP public key block Public-Key (old)
Create a keyring
gpg --no-default-keyring --keyring ./teamviewer_keyring.gpg --import teamviewer.key
This file is still not a valid key that can be added to /etc/apt/trusted.gpg.d/ since it's a keyring, but from the keyring we can extract the key with
gpg --no-default-keyring --keyring ./teamviewer_keyring.gpg --export > ./teamviewer.gpg
This file is the key you want to move to the trusted key folder
sudo mv ./teamviewer.gpg /etc/apt/trusted.gpg.d/
happy
sudo apt update
!!!