51

Recently tried to update emacs packages and got this.

Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2019-10-02T10:10:02+0100 using RSA
Command output:
gpg: Signature made Wed 02 Oct 2019 10:10:02 AM BST
gpg:                using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key

Any ideas why?

Yuki
  • 3,857
  • 5
  • 25
  • 43

3 Answers3

40

See https://emacs.stackexchange.com/questions/233/ for the same question.

The signature check failed because you don't have the new key (the old signature key expired on Sep 23). The new key is available from the usual GPG key-servers, comes with Emacs≥26.3, and can also be obtained by installing the package gnu-elpa-keyring-update.

Stefan
  • 27,908
  • 4
  • 53
  • 82
  • 2
    I see that the options are either disable signature verification (that I obviously do not want to do) or download package that do it for me. Is it possible just import the new keys to gpg without installing side dependencies? – Yuki Oct 13 '19 at 18:19
  • 11
    well i see this error when i tried to install "Failed to verify signature: "gnu-elpa-keyring-update-2019.3.tar.sig" – papachan Oct 30 '19 at 21:37
  • 13
    @papachan Did you also try the option to update manually with gpg? Currently `gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40` (see the package’s website) – Simon A. Eugster Nov 29 '19 at 08:58
  • @papachan, see the README of gnu-elpa-keyring-update which offers workarounds. – malana Dec 23 '19 at 14:09
  • @SimonA.Eugster the command gives me `gpg: Invalid option "--receive-keys"` – Asalle Jul 16 '20 at 08:37
  • @Asalle Funny. I'm not a gpg expert, but 2.2.19 lists this option in the help output (`gpg --help`). Are you using an older version? – Simon A. Eugster Jul 27 '20 at 15:17
  • @SimonA.Eugster yes, it turned out I used an outdated version – Asalle Jul 27 '20 at 15:35
  • 6
    got `gpg: keyserver receive failed: General error` on gpg --receive-keys. No way to install `gnu-elpa-keyring-update` neither. – jaromrax Jul 30 '20 at 21:03
  • 1
    I have followed the same steps and I also get the "General error" message as @jaromrax – Leo Aug 27 '20 at 13:16
  • Got the same 'General error', so tried the 'modify expiration date', but got: gpg: "474F05837FBDEF9B" is not a fingerprint. For now I guess its 'temporarily disable signature verification'. – AAAfarmclub Nov 11 '20 at 01:38
  • I get that failure with 27.2… – Jürgen A. Erhard Jul 25 '21 at 19:46
2

Try renaming your ~/.emacs.d/elpa/gnupg file to something else as a backup and then run M-x package-refresh-contents. This is what worked for me.

Aaron F
  • 421
  • 4
  • 8
0

I got a similar error in Windows 10 including the following line

gpg: keyblock resource '/c/Users/<theuser>/c:/Users/<theuser>/.emacs.d/elpa/gnupg/pubring.kbx': No such file or directory

It turned out that Emacs was using the GnuPG installed via MSYS2. Installing the Windows version of GnuPG (Gpg4win) solved it.

C. Aknesil
  • 186
  • 3