Tips & Tricks for Technologists & System Administrators | About & Contact

Apt-get Update GPG Key Errors and Fix



Running sudo apt-get upgrade, I started getting this error:

1
Reading package lists... Done
1
W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 313D312748A22A95
1
W: You may want to run apt-get update to correct these problems

Ah ha! But apt-get update is the command causing this problem.

The solution is to import this key from the gpg servers; I don’t know why this isn’t done automatically, but here is it:

1
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 313D312748A22A95; gpg --export --armor 313D312748A22A95 | sudo apt-key add -

Resulting in:

1
2
3
4
5
6
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --recv-keys --keyserver keyserver.ubuntu.com 313D312748A22A95
gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com
gpg: key 48A22A95: public key "Launchpad PPA for Filip Brcic" imported
gpg: Total number processed: 1
gpg:              unchanged: 1
OK

Congrats! sudo apt-get update now works properly!


Originally posted 20090317 and last touched 20090317
Dave Drager+ is the Chief Technology Officer at XDA-Developers, where he keeps the server farm running efficiently for millions of visitors per day. He has written previously for the technology blogs Lifehacker and MakeUseOf.


  • Pingback: Dave Drager

  • Runaway1956

    Ahhh. One more little annoyance solved. Now, to save this page to hard drive, for future reference when I have no internet!

  • Runaway1956

    Ahhh. One more little annoyance solved. Now, to save this page to hard drive, for future reference when I have no internet!

  • X

    I am unable to do this.
    Please see error below. Any help would be appreciated.
    Thanks.

    ~$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com FE85409EEAB40ECCB65740816AF0E1940624A220

    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com FE85409EEAB40ECCB65740816AF0E1940624A220
    gpg: requesting key 0624A220 from hkp server keyserver.ubuntu.com
    gpg: keyserver timed out
    gpg: keyserver receive failed: keyserver error

  • X

    I am unable to do this.
    Please see error below. Any help would be appreciated.
    Thanks.

    ~$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com FE85409EEAB40ECCB65740816AF0E1940624A220

    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com FE85409EEAB40ECCB65740816AF0E1940624A220
    gpg: requesting key 0624A220 from hkp server keyserver.ubuntu.com
    gpg: keyserver timed out
    gpg: keyserver receive failed: keyserver error

  • Harrison Freeman

    I am unable to download the key. I get this error

    sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95; gpg –export –armor 313D312748A22A95 | sudo apt-key add –

    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95
    gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com
    gpgkeys: HTTP fetch error 7: couldn’t connect to host
    gpg: no valid OpenPGP data found.
    gpg: Total number processed: 0
    gpg: WARNING: nothing exported
    gpg: no valid OpenPGP data found.

  • Harrison Freeman

    I am unable to download the key. I get this error

    sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95; gpg –export –armor 313D312748A22A95 | sudo apt-key add –

    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95
    gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com
    gpgkeys: HTTP fetch error 7: couldn’t connect to host
    gpg: no valid OpenPGP data found.
    gpg: Total number processed: 0
    gpg: WARNING: nothing exported
    gpg: no valid OpenPGP data found.

  • Victoria

    Thanks. Synaptic has stopped complaining.

    I thought you might like to know I received this error.
    —————————————-
    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 60D11217247D1CFF
    gpg: requesting key 247D1CFF from hkp server keyserver.ubuntu.com
    gpg: key 247D1CFF: public key “Launchpad PPA for OpenOffice.org Scribblers” imported
    gpg: no ultimately trusted keys found
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)
    victoria@ubuntu-home:~$ gpg –export –60D11217247D1CFF| sudo apt-key add –
    gpg: Invalid option “–60D11217247D1CFF”
    gpg: no valid OpenPGP data found.
    victoria@ubuntu-home:~$ gpg –export –armor 60D11217247D1CFF| sudo apt-key add –
    OK
    ——————————————–
    As Synaptic seems to have the key now, I don’t understand the error.

    Thanks again,

    Victoria

  • Victoria

    Thanks. Synaptic has stopped complaining.

    I thought you might like to know I received this error.
    —————————————-
    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 60D11217247D1CFF
    gpg: requesting key 247D1CFF from hkp server keyserver.ubuntu.com
    gpg: key 247D1CFF: public key “Launchpad PPA for OpenOffice.org Scribblers” imported
    gpg: no ultimately trusted keys found
    gpg: Total number processed: 1
    gpg: imported: 1 (RSA: 1)
    victoria@ubuntu-home:~$ gpg –export –60D11217247D1CFF| sudo apt-key add –
    gpg: Invalid option “–60D11217247D1CFF”
    gpg: no valid OpenPGP data found.
    victoria@ubuntu-home:~$ gpg –export –armor 60D11217247D1CFF| sudo apt-key add –
    OK
    ——————————————–
    As Synaptic seems to have the key now, I don’t understand the error.

    Thanks again,

    Victoria

  • Craig

    I get this error!

    root@Geantuser:~# sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95; gpg –export –armor 313D312748A22A95 | sudo apt-key add –
    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95
    gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com
    gpgkeys: HTTP fetch error 7: couldn’t connect to host
    gpg: no valid OpenPGP data found.
    gpg: Total number processed: 0
    gpg: /home/geantuser/.gnupg/gpg.conf:138: invalid option
    gpg: no valid OpenPGP data found.

    line 138 is the correct proxy. without it the error isthe same but without the error about the proxy.

  • Craig

    I get this error!

    root@Geantuser:~# sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95; gpg –export –armor 313D312748A22A95 | sudo apt-key add –
    Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95
    gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com
    gpgkeys: HTTP fetch error 7: couldn’t connect to host
    gpg: no valid OpenPGP data found.
    gpg: Total number processed: 0
    gpg: /home/geantuser/.gnupg/gpg.conf:138: invalid option
    gpg: no valid OpenPGP data found.

    line 138 is the correct proxy. without it the error isthe same but without the error about the proxy.

  • http://www.barbariancoders.com Crypto

    If you copy+paste the code from the article you MAY need to retype the “–” double dash. For some reason browser shows it as a special character.

    Also – “sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95″ should be enough to add the key and not show the “signatures couldn’t be verified” message

  • http://www.barbariancoders.com Crypto

    If you copy+paste the code from the article you MAY need to retype the “–” double dash. For some reason browser shows it as a special character.

    Also – “sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95″ should be enough to add the key and not show the “signatures couldn’t be verified” message