每当我运行M-x package-refresh-contents
or时,我都会收到此错误M-x package-list-packages
,这与 Emacs 密钥环更新有关:
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2020-12-16T17:05:02-0500 using RSA
Command output:
gpg: Signature made Wed 16 Dec 2020 05:05:02 PM EST
gpg: using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key
我正在尝试按照http://elpa.gnu.org/packages/gnu-elpa-keyring-update.html中的步骤手动更新 ELPA 密钥环。我无法使用M-x package-install RET gnu-elpa-keyring-update RET
(它说[No match]
当我发出该命令时)安装包。
在同一页面中,列出了手动修复此问题的三种不同方法。我尝试了前两个,但都不起作用。
$ gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
gpg: keyserver receive failed: General error
$ gpg --homedir ~/.emacs.d/elpa/gnupg --quick-set-expire 474F05837FBDEF9B 1y
gpg: "474F05837FBDEF9B" is not a fingerprint
现在,我该如何尝试第三种方式(暂时禁用签名验证)?
一些系统细节:
$ emacs --version
GNU Emacs 25.2.2
Copyright (C) 2017 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$ uname -a
Linux jetson 4.9.140-tegra #1 SMP PREEMPT Tue Oct 27 21:02:37 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
我在Ubuntu 18.04 (Bionic)上遇到了同样的问题。
https://emacs.stackexchange.com/questions/60554/cannot-run-melpa-package-refresh-due-to-gpg-errors上的说明为我解决了这个问题:
生成使用以下行调用
gpg.conf
的文件:~/.emacs.d/elpa/gnupg/
然后,运行以下命令:
现在,Emacs应该能够从Elpa获取数据而不会出现任何错误消息: