简体   繁体   English

更新emacs包时出错:无法下载'gnu'存档

[英]Error updating emacs packages: Failed to download 'gnu' archive

My init.el uses this to initialize packages: 我的init.el使用它来初始化包:

(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))

When I do Mx package-refresh-contents I get the following error: Failed to download `gnu' archive. 当我执行Mx package-refresh-contents我收到以下错误: Failed to download `gnu' archive.

Mx toggle-debug-on-error gives me this stacktrace: Mx toggle-debug-on-error给了我这个堆栈跟踪:

Debugger entered--Lisp error: (error "Failed to verify signature archive-contents.sig: (\"No public key for 474F05837FBDEF9B created at 2014-09-29T07:20:03-0700 using DSA\")")
  signal(error ("Failed to verify signature archive-contents.sig: (\"No public key for 474F05837FBDEF9B created at 2014-09-29T07:20:03-0700 using DSA\")"))
  error("Failed to verify signature %s: %S" "archive-contents.sig" ("No public key for 474F05837FBDEF9B created at 2014-09-29T07:20:03-0700 using DSA"))
  package--check-signature("http://elpa.gnu.org/packages/" "archive-contents")
  package--download-one-archive(("gnu" . "http://elpa.gnu.org/packages/") "archive-contents")

Is this a problem with my configuration, and how would I fix it? 这是我的配置问题,我该如何解决?

Looks like a bug in your version of Emacs. 看起来像您的Emacs版本中的错误。 You can probably circumvent it by setting package-check-signature to nil. 您可以通过将package-check-signature为nil来绕过它。

My issue was that I was missing gpg (gnupg). 我的问题是我错过了gpg(gnupg)。

On OSX I solved this by using brew install gpg . 在OSX上,我通过使用brew install gpg解决了这个问题。

对于没有签名问题的其他人,请尝试初始化包

Mx package-initialize

I installed emacs on Arch Linux, opened it, ran package-refresh-contents and got this issue. 我在Arch Linux上安装了emacs,打开它,运行package-refresh-contents并得到了这个问题。 After a while, I realized I had no init file. 过了一会儿,我意识到我没有init文件。 If this is your case, create your init file with emacs ~/.emacs.d/init.el and then add the following content: 如果是这种情况,请使用emacs ~/.emacs.d/init.el创建init文件,然后添加以下内容:

(package-initialize)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))

Save it with Cx Cs and run package-refresh-contents again. 使用Cx Cs保存并再次运行package-refresh-contents This time it will work. 这次它会起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM