This morning I ran into a small problem apt-get update, which wanted some keys to run the update.

I got the following errormessage:

You can fix this problem for security.debian.org and ftp.de.debian.org by installing the package debian-archive-keyring:

But this does not solve the problem for other hosts, like ftp.nerim.net:

First add their keys to the gpg keyring. Take the ID (the part behind NO_PUBKEY) and request the corresponding key from a keyserver:

Update 2011-02-26:
A friendly commenter reported problems with wwwkeys.eu.pgp.net, thank you for this workaround: just replace it with pgpkeys.mit.edu and follow the instructions.

Export the key from gpg and add it to your list of trusted keys for apt with apt-key:

Update:

just encountered the same problem again with the opera.com, luckily I remebered my own post :-)

and once again (how many different keys do they need?)


18 Responses to “Fixing gpg errors with apt-get for dummies like me”

  1. 1

    i was able to get the first part Thank You!!!! but this part i did not understand please help me with this part thanks
    bernie
    Mr.B’s computer service center
    812-667-7478

    gpg –keyserver hkp://wwwkeys.eu.pgp.net –recv-keys 07DC563D1F41B907
    gpg: requesting key 1F41B907 from hkp server wwwkeys.eu.pgp.net
    gpg: key 1F41B907: “Christian Marillat ” not changed
    gpg: Total number processed: 1
    gpg: unchanged: 1

    Export the key again and add it with apt-key:

    gpg –armor –export 07DC563D1F41B907 | apt-key add -

    Bernie (April 17th, 2006 at 18:39)
  2. 2

    Bernie, added some explanations. Is it clearer now?

    Frank Spychalski (April 23rd, 2006 at 16:45)
  3. 3

    Great info. Very clean and easy to read. This is the one thing which I have never been able to memorize.. the requesting a gpg key from a keyserver. Thanks guys!

    [email protected] (August 4th, 2007 at 12:52)
  4. 4

    I had same problem, but the process above, not work.
    I obtain this message:
    jhon:/etc/apt# gpg –armor –export 07DC563D1F41B907 | apt-key add -
    gpg: [don't know]: invalid packet (ctb=23)
    gpg: keydb_get_keyblock failed: eof
    gpg: [don't know]: invalid packet (ctb=23)
    gpg: /etc/apt/trusted.gpg: copy to `/etc/apt/trusted.gpg.tmp’ failed: invalid packet
    gpg: error writing keyring `/etc/apt/trusted.gpg’: invalid packet
    gpg: error reading `-’: invalid packet
    gpg: import from `-’ failed: invalid packet
    jhon:/etc/apt#

    Please, helpme.

    jhon

    jhon (June 10th, 2008 at 02:38)
  5. 5

    Sorry, this is a gpg error I haven’t seen. You should ask on a gpg mailing list…

    Frank Spychalski (June 10th, 2008 at 10:37)
  6. 6

    THanks a lot for info) This warning constantly bothered me till your article)

    Dmity (June 24th, 2008 at 19:57)
  7. 7

    [...] Gespeichert unter: Nicht kategorisiert — nickolsen @ 5:35 Uhr nachmittags Klick mich! Klappt [...]

  8. 8

    Thanks a lot. Worked very well and helped me a lot!

    greetz Nick

    Nick (September 25th, 2008 at 20:47)
  9. 9

    Hello Folks!

    In first, I’m a Brazilian guy and I’m still studying this idiom, so, sorry for my mistakes! =D

    So, I found an information that can be very important related with that problem described here.

    Look that here: http://cultoffree.wordpress.com/2009/02/03/w-gpg-errorno_pubkey-60d11217247d1cff-wtf/

    I followed that tutorial and resolved my problem:

    $$$:/home/$$$$/.opera# gpg –keyserver keyserver.ubuntu.com –recv 07DC563D1F41B907
    gpg: requesting key 1F41B907 from hkp server keyserver.ubuntu.com
    gpg: key 1F41B907: “Christian Marillat ” not changed
    gpg: Número total processado: 1
    gpg: não modificados: 1
    $$$:/home/$$$$/.opera# gpg –export –armor 07DC563D1F41B907 | apt-key add -
    OK
    $$$:/home/$$$$.opera# apt-get update
    Baixados 387B em 2s (137B/s)

    Lendo listas de pacotes… Pronto

    []‘s
    @alcarrolikis

    Cristiano Miranda (September 9th, 2009 at 02:04)
  10. Fixing apt-get GPG errors (October 1st, 2009 at 17:53)
  11. 11

    Thanks a lot! I too ran into this problem updating Opera.

    Concerning jhon’s error message; if you’re not in a root shell (which # – unlike $ – usually indicate) you might want to try something like this:

    $ gpg –armor –export 07DC563D1F41B907 | sudo apt-key add -

    Best wishes, Mattias

    Mattias (November 1st, 2009 at 19:53)
  12. 12

    [...] from: http://amazing-development.com/archives/2006/02/24/fixing-gpg-errors-with-apt-get-for-dummies-like-m… ERROR: W: GPG error: http://updates.xensource.com etch Release: The following signatures couldn’t [...]

    Fixing apt-get GPG errors » (January 29th, 2010 at 22:09)
  13. 13

    Thank you Mattias @ (November 1st, 2009 at 19:53)

    Sudo apt-key ! Doh!

    stephen@stephen-desktop:~$ gpg –armor –export 9AA38DCD55BE302B | apt-key add -
    gpg: no writable keyring found: eof
    gpg: error reading `-’: general error
    gpg: import from `-’ failed: general error

    stephen@stephen-desktop:~$ gpg –armor –export 9AA38DCD55BE302B | sudo apt-key add -
    OK
    stephen@stephen-desktop:~$

    StephenW (June 6th, 2010 at 12:00)
  14. 14

    JFYI
    To cope with VirtualBox just do the following:
    1. Download by any means oracle_vbox.asc from http://download.virtualbox.org/virtualbox/debian/
    2. Put it to your keys repository like there:
    cat – |sudo apt-key add -
    (I consider a simple copy-paste from the site here, YMMV)

    Yury (June 16th, 2010 at 10:18)
  15. 15

    awesome. done it!

    phonemic_chip (September 1st, 2010 at 14:31)
  16. 16

    Really great! Fixed in one step!
    Thanks a lot,
    Eduardo

    Eduardo Linhalis (February 17th, 2011 at 22:47)
  17. 17

    hkp://wwwkeys.eu.pgp.net did not respond to me,luckily I found this one:

    gpg –keyserver pgpkeys.mit.edu –recv-key 51716619E084DAB9
    gpg -a –export 51716619E084DAB9 | sudo apt-key add -

    S (February 26th, 2011 at 19:39)
  18. 18

    Thank you. I will add it inline for the others…

    Frank Spychalski (February 26th, 2011 at 19:41)

Any comments? Or questions? Just leave a Reply: