How to fix “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead”

There are many ways to install a software in Linux such as building from source, downloading a deb package, and installing from a package manager. I like the last approach the most due to it’s convenience. However, not all softwares can be found in the official repository. Some publishers, like AnyDesk, require you to add their repository and the signing key into your system.

However, when running the given command, you will get a warning saying apt-key is deprecated. So what to do now?

The solution is simple. Rather than using apt-key, we can just write the signing key into /etc/apt/trusted.gpg.d. But, before writing it into a file, the key as to go through GPG dearmor first.

$ wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/anydesknew.gpg

So, instead of having a file that looks like this:

It will look something like this:

Now, you can install the repository, update your package cache and install the software you want.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.