Trying to fix a problem with my keys on Ubuntu Trusty :
$ apt-key list >/dev/null
gpg: [don't know]: invalid packet (ctb=2d)
gpg: keydb_search_next failed: invalid packet
So I have backed up my keys from PPA repos into /etc/apt/trusted.gpg.d.BACKUP/
:
$ sudo mv /etc/apt/trusted.gpg.d /etc/apt/trusted.gpg.d.BACKUP
$ apt-key list | grep gpg$
/etc/apt/trusted.gpg
And then I imported the keys back to GPG :
$ sudo mkdir /etc/apt/trusted.gpg.d/
$ for file in $(\ls /etc/apt/trusted.gpg.d.BACKUP/ | grep gpg$)
> do
> sudo gpg --no-default-keyring --keyring /etc/apt/trusted.gpg.d/$file --import /etc/apt/trusted.gpg.d.BACKUP/$file
> done
gpg: keyring `/etc/apt/trusted.gpg.d/andykimpe-gparted.gpg' created
gpg: key 274A7DA0: public key "Launchpad PPA for andykimpe" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
...
gpg: keyring `/etc/apt/trusted.gpg.d/openlp-core-release.gpg' created
gpg: key DF629112: public key "Launchpad Development Packages" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
$
And when I check, I still have the same :
$ apt-key list | grep gpg$
/etc/apt/trusted.gpg
It is as if nothing had been imported.
Can you help ?
It was a permission issue :
Then I looped over the missing keys with the command
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
and now it is finally solved.