4

I frequently receive errors as follows while running apt-get update:

[...] 
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pdfmod-team-ppa.gpg': resource limit 
gpg: keyblock resource `/etc/apt/trusted.gpg.d/rael-gc-scudcloud.gpg': resource limit 
gpg: keyblock resource `/etc/apt/trusted.gpg.d/voldyman-markmywords.gpg': resource limit

The above keys are just examples and not limited to those programs. It occurs generically with all software that I added from a PPA.

  • Curious, how do you add the PPA normally? – user173 Jul 1 '15 at 11:12
  • This looks like an issue where there are too many keyrings, and there are instructions to fix it over on AskUbuntu. – Lewis Goddard Jul 1 '15 at 12:09
  • @rifsta With add-apt-repository -y ppa:<ppa-name>. @LewisGoddard I found another solution suggesting to use launchpad-getkeys. Should I add it below as an answer myself? – orschiro Jul 2 '15 at 6:09
  • @orschiro yes, I think you should. – Avi Romanoff Jul 3 '15 at 10:06
  • It worked. Before that I tried to import keys manually with no success. – user5529 Jul 10 '16 at 9:39
5

This seems to be this bug.

Someone suggested this:

The solution that worked for me was emptying /etc/apt/trusted.gpg.d, running apt-get update, and then manually adding every key it blocked on to the main /etc/apt/trusted.gpg keyring with apt-key adv as described above.

So run these commands

sudo mv /etc/apt/trusted.gpg.d/ /etc/apt/trusted.gpg.d.backup
sudo mkdir /etc/apt/trusted.gpg.d
sudo chmod 755 /etc/apt/trusted.gpg.d

and add each key again with this:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5

OR

sudo apt-get install launchpad-getkeys
launchpad-getkeys

where you replace the hash with your needed key's hash.

  • I just added an option to use launchpad-getkeys which if you do a hexdump -C on the binary you can see it is just a loop of apt-key adv .... – Elijah Lynn Jun 30 '18 at 3:04
2

One may try launchpad-getkeys.

  1. Delete all the contents in /etc/apt/trusted.gpg.d/.
  2. Add $ sudo add-apt-repository ppa:nilarimogard/webupd8 repository
  3. sudo apt-get update your local database
  4. Install $ sudo apt-get install launchpad-getkeys
  5. Run $ sudo launchpad-getkeys
  6. Check $ sudo apt-get update if the error is gone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.