Recently I had a lot of GPG errors with the following message

W: GPG error: http://ppa.launchpad.net trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY *****************

I removed them with using What is the easiest way to resolve apt-get BADSIG GPG errors? and with the help from other sites. But now every time I add new PPA and try to update I got the GPG Error for the last added PPA.

Using Y-PPA > Advanced > Try to import all missing GPG keys removes the error/s but it will show again for every new PPA added. Can someone tell me why I got GPG error every time and how to fix it permanently.

using Ubuntu 14.04 x64 EDIT: Problem solved. I was missing /etc/apt/trusted.gpg.d

  • how many ppas do you have? you can have only so many gpg keys installed. also, how do you add a ppa? sudo add-apt-repository?
    – mchid
    Oct 25, 2015 at 6:37
  • I have around 40 PPAs , and yes I use sudo add-apt-repository. I didn't have problems two months ago, this thing start to happen in one month maybe.
    – Tosho
    Oct 25, 2015 at 7:52

1 Answer 1


The problem is that you have too many ppas.

Apt can only handle 40 keys in /etc/apt/trusted.gpg.d.

Delete some gpg keys and ppas.

See here for some more info.


Because you have no /etc/apt/trusted.gpg.d directory, just run the following command to fix the issue:

sudo mkdir /etc/apt/trusted.gpg.d
  • they are exactly 37 PPAs, and I did delete some before. And I don't have /etc/apt/trusted.gpg.d only - apt.conf.d, preferences.d,, sources.list.d
    – Tosho
    Oct 25, 2015 at 7:58
  • @Tosho sorry, the limit is 40 keys not 40 ppas. delete some keys
    – mchid
    Oct 25, 2015 at 8:01
  • @Tosho also, what happened to this directory? no wonder you are having this problem adding keys, the directory does not exist.
    – mchid
    Oct 25, 2015 at 8:03
  • I might deleted the folder - bugs.launchpad.net/apt/+bug/1263540/comments/35
    – Tosho
    Oct 25, 2015 at 8:15
  • 1
    I have /etc/apt/sources.list.d ? do you mean - /etc/apt/trusted.gpg.d/ ?
    – Tosho
    Oct 25, 2015 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .