HomeBlogsHow to fix apt-key deprecated warning in Ubuntu

How to fix apt-key deprecated warning in Ubuntu

In this article we will try to teach you how to fix the apt-key deprecated warning in Ubuntu. If you try to add an APT repository key with apt-key on Debian, Ubuntu and Linux distributions based on it, you will see the following message: “Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))”. The apt-key man page mentions that the “use of apt-key is deprecated, except for use of apt-key del in maintainer scripts to remove existing keys from the master keyring”. Also, “apt-key will be available last in Debian 11 and Ubuntu 22.04.”

Ubuntu is a Linux-based operating system. It was developed for computers, smartphones and network servers. The system is made by a UK based company called Canonical Ltd. developed. All the principles used to develop the Ubuntu software are based on the principles of open source software development. Below we have mention the steps to resolve apt-key deprecated warning in Ubuntu.

Fix apt-key deprecated warning in Ubuntu Linux

Method 1: the sensible way

Step 1: First, open a new Terminal window and then look inside your legacy apt-key file by running this command:

sudo apt-key list

Depending on your system you may see a couple of entries appear or a veritable avalanche.

Step 2: Scroll carefully through the list. Pay attention to how things are arranged. Find the section that mentions the package listed in the first warning (if you see multiple warnings, you’ll need to repeat these steps for each one in turn).

Step 3: Copy the last 8 characters from the second line — in the our case it is 0C12 89C0 — and convert it to a .gpg file using the command below. Remember to drop the space between the 8 characters and specify a gpg file name that is relevant to the package the key is for.

Step 4: Once you’ve constructed your command hit enter …That’s all you need to do.

Step 5: When you next run an apt update the deprecated key error will no longer appear for the repo you just applied (though if you have more than one repo affected, you’ll need to repeat the steps above for each one).

Method 2: the Fast way

Step 1: open a new Terminal window and run:

cd /etc/apt

Step 2: Followed by:

sudo cp trusted.gpg trusted.gpg.d

Step 3: Enter your password as prompted and hit enter to apply.

Step 4: When you next run apt update the error in question will no longer appear.

Final Words

We hope our article on how to resolve apt-key deprecated warning problem in Ubuntu Linux will help you and resolve all your problems. Linux is a family of operating systems based on the Linux kernel – the core of an operating system. It enables communication between hardware and software components. If you want to know how to fix apt-key deprecated warning then follow the steps mentioned above.

I hope you understand this article, How to fix apt-key deprecated warning in Ubuntu.

James Hogan
James Hogan is a senior staff writer at Bollyinside, where he has been covering various topics, including laptops, gaming gear, keyboards, storage, and more. During that period, they evaluated hundreds of laptops and thousands of accessories and built a collection of entirely too many mechanical keyboards for their own use.


Must Read

- Advertisment -