Error updating emacs packages: Failed to download 'gnu' archive

后端 未结 5 2089
忘了有多久
忘了有多久 2021-02-02 08:16

My init.el uses this to initialize packages:

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


        
5条回答
  •  情书的邮戳
    2021-02-02 08:50

    I installed emacs on Arch Linux, opened it, ran package-refresh-contents and got this issue. After a while, I realized I had no init file. If this is your case, create your init file with emacs ~/.emacs.d/init.el and then add the following content:

    (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 C-x C-s and run package-refresh-contents again. This time it will work.

提交回复
热议问题