4

I'm getting this error while trying download a package from ELPA:

 Failed to verify signature archive-contents.sig:
 No public key for 474F05837FBDEF9B created at 2018-11-28T14:10:03-0800 using DSA
 Command output:
 gpg: keyblock resource '/c/apps/emacs-25.3_1/bin/c:/users/myuserid/.emacs.d/elpa/gnupg/pubring.kbx': No such file or directory
 gpg: Signature made Wed Nov 28 14:10:03 2018 PST
 gpg:                using DSA key CA442C00F91774F17F59D9B0474F05837FBDEF9B
 gpg: Can't check signature: No public key

I've been doing some clean up in my init file but I don't see how it could have impacted this. In a way it's a good thing because it's a good opportunity to setup gpg but it's not working for me. I used customize-apropos to set these values:

  '(epg-gpg-home-directory "C:/Program Files/Git")
  '(epg-gpg-program "gpg.exe --homedir /c/users/myuserid/.emacs.d/elpa/gnupg")

I'm using the gpg that comes with my git client. However, no matter what I set it doesn't seem to care, it still has the invalid path the keys.

What could be causing these gpg variables to not be respected??

0
3

I encountered this issue. I solved it using the following steps in order:

  1. Installing Gpg4win
  2. Make sure that the folder c:/Progra~2/GnuPG/bin is on your path before any other installed versions of the GnuPG executables (in my case, I had it installed via msys2).

Note that Progra~2 expands to "Program Files (x86)" on my system (I am using the 64 bit version of Windows, you might need to substitute Progra~1 in the string if you are using a 32 bit version of Windows).

2
0

Emacs' package infrastructure uses its own variable for GPG, package-gnupghome-dir. For me (and, obviously, you here) it failed because Emacs' filename functions don't see the path as an absolute path (see the "/c:/users/" in the "keyblock" line). Thus, it does what it does with relative paths, it finds them (or tries to) in the current directory.

Change the beginning of package-gnupghome-dir from "C:/" to "/c/"… that should fix it, but I only tested it on my (msys2) system. YMMV ;-)

0

I solved this issue using above solutions in tandem.

I changed the package-gnupghome-dir as suggested. This got me partway there. I then got a different error, Can't check signature: No public key. So, I ran

$ gpg --homedir /c/Users/micha/AppData/Roaming/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40

gpg: key 066DAFCB81E42C40: public key "GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org>" imported

and the issue was resolved. Thanks, @preetpalS and @jürgen-a-erhard!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.