How to get rid of apt-key deprecation warning on Ubuntu 22.04

If you’ve recently upgraded to Ubuntu 22.04, you may be seeing deprecation warnings related to the ZeroTier download site when using apt commands like this listed below:

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

To fix this warning, you can run this command in the shell.

curl -s | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ > /dev/null

Next time you do an apt update after running the command above, the warning about the zerotier package repository will be gone!

1 Like