Please disable your ad blocker.
The only ads on this site are discreet (sidebar on desktop, below the content on mobile).They do not interfere with reading and may even offer you benefits (discounts, free months…).
Fix GPG key error when adding a PPA with apt-key
Since Ubuntu 22.04 and derivative distributions such as Linux Mint 21, adding a PPA using the command sudo add-apt-repository ppa:lutris-team/lutris triggers the following error: Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). during each sudo apt update.
Here are two methods to fix the problem:
Method for EACH problematic PPA
For this example, I will use the Lutris PPA.
- Open the terminal
- List the GPG keys:
Which gives, for Lutris:sudo apt-key listpub rsa4096 2019-03-23 [SC] 82D9 6E43 0A1F 1C0F 0502 747E 37B9 0EDD 4E3E FAE4 uid [ unknown] Launchpad PPA for lutris - Export the GPG key (using only the last 8 characters of the ID):
sudo apt-key export 4E3EFAE4 | sudo gpg --dearmour -o ~/Desktop/lutris-keyring.gpg - Remove all keys related to the Lutris PPA to avoid duplicates:
sudo apt-key del 4E3EFAE4 - Copy the file
~/Desktop/lutris-keyring.gpgto the correct location:sudo cp ~/Desktop/lutris-keyring.gpg /etc/apt/trusted.gpg.d sudo apt updateshould no longer display any errors.
Global method (to do once)
- Open the terminal and type the following:
cd /etc/apt sudo cp trusted.gpg trusted.gpg.d sudo apt update - The issue is fixed 😊
Comments