Root task: trying to install R mode for emacs (ESS following - https://stackoverflow.com/questions/1422987/emacs-mode-for-r)
OS: Ubuntu 18.04
Problem: When I run M-x package-refresh-contents RET
I get the following error:
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2020-09-08T10:05:02+0100 using RSA
Command output:
gpg: WARNING: unsafe permissions on homedir '/home/xxx/.emacs.d/elpa/gnupg'
gpg: Signature made Tue 08 Sep 2020 10:05:02 BST
gpg: using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key
I tried following the accepted answer at: How to proceed on package.el signature check failure
Updating the public keys using M-x package-install RET gnu-elpa-keyring-update RET
gives [No match]
.
If I try to update the keys manually using gpg:
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
gives
gpg: WARNING: unsafe permissions on homedir '/home/xxx/.emacs.d/elpa/gnupg'
gpg: keyserver receive failed: General error
Sure enough if I go to keyserver.ubuntu.com and search for the fingerprint I find nothing. Furthermore, if I try to extend the expiration date of the old key (another workaround suggested):
gpg --quick-set-expire 474F05837FBDEF9B 1y
gives
gpg: "474F05837FBDEF9B" is not a fingerprint
Can anyone explain why this is failing? I'm not massively familiar with gpg.
Update
Following advice in the comments I managed to fix the permissions on ~/.emacs.d/elpa/gnupg
so the warning is gone, however the error persists. Running M-x package-refresh-contents RET
now results in:
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2020-09-09T10:05:02+0100 using RSA
Command output:
gpg: Signature made Wed 09 Sep 2020 10:05:02 BST
gpg: using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key
Similarly, running:
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
just gives:
gpg: keyserver receive failed: General error