I just did a clean install of emacs 26.1 on multiple computers running different OS (Ubuntu, Mint, Windows), and for some reason I cannot update my packages using M-x refresh-package-contents
. I've also re-installed emacs25 through apt with no change in results. Emacs gets caught in an infinite loop trying to connect to elpa or Melpa, with the message:
Contacting host: elpa.gnu.org:443
For more information, here is my init file:
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
On ubuntu i'm getting:
Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed \"failed with code 113\" :host \"elpa.gnu.org\" :service 80)")
I should note that I am not using a proxy, and I am on a home network. I also know that gnuTLS is properly installed on the windows machine, as it came packaged with emacs 26.1. You might see similar questions on the forum already, but they do not have solutions that fit my needs.
EDIT:
As Nega suggested, I ran an uninitialized instantiation of emacs and tried to manually update the packages. Here are the contents of my Messages buffer after:
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Quit
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:80
Failed to download ‘gnu’ archive.
Importing package-keyring.gpg...done
You can run the command ‘list-packages’ with M-x l-pac RET
Package refresh done
error in process sentinel: Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed "failed with code 113
" :host "elpa.gnu.org" :service 80)
error in process sentinel: Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed "failed with code 113
" :host "elpa.gnu.org" :service 80)
Mark set
After debugging (list-packages) again, this is the backtrace:
Debugger entered--Lisp error: (error "Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed \"failed with code 113
\" :host \"elpa.gnu.org\" :service 80)")
signal(error ("Error retrieving: http://elpa.gnu.org/packages/archive-contents (error connection-failed \"failed with code 113\n\" :host \"elpa.gnu.org\" :service 80)"))
#[257 "p\306\307!\210\310\311!r\211q\210\312\313\314\315\316!\317\"\320$\216\3211R
url-http-activate-callback()
url-http-async-sentinel(#<process elpa.gnu.org<1>> "failed with code 113\n")
elpa.gnu.org
isn’t exactly five 9’s stable. Try it in your web browser. If it doesn’t work there it won’t work in Emacs. Try again in a hour.