0

When I am trying to do M-x package-refresh-contents I get Contacting host: elpa.gnu.org:80 stuck until I do C-g. I tried to install a package and it didn't work through M-x package-install *package_name* and it didn't work, so I started to search for a solution. I can't find the exact command I ran, but it was related to TLS and something with the word "Normal" IIRC. After doing so, my connection to repositories stopped working. I checked and changed many times my package-list, this is my current init.el code snippet related to links to melpa etc:

(setq package-archives                                                                                                                                                                                     
      '(("gnu" . "http://elpa.gnu.org/packages/")                                                                                                                                                          
        ("marmalade" . "http://marmalade-repo.org/packages/")                                                                                                                                              
        ("melpa" . "http://melpa.org/packages/"))) 

I also tested HTTPS connections, it works through eww and opens elpa.gnu link, giving me a list of packages, melpa.org site also works, but marmalade-repo is stuck in Loading http://marmalade-repo.org/packages/... . Not sure how to fix the emacs now, I also upgraded from the 26 version to 27, it didn't work. Currently using a workaround via using "Straight" package installation, but I want to try to understand what is wrong and how to fix it.

3
  • 1
    I believe you want https for both gnu and melpa, and furthermore that marmalade may no longer be active (I didn't think it was still running, and while the domain is valid, it seemingly doesn't have a current certificate). You would rarely want to prefer http when https was supported.
    – phils
    Jun 16 at 9:03
  • Yeah, need to add the parenthesis in my first post, it's in place in my init.el. It looks like maybe deleting marmalade and adding s to http fixed an issue, at least refresh now works, but need to check if packages can be successfully installed.
    – Jermog
    Jun 16 at 10:40
  • Yes, it looks like melpa is indeed was the root of the problem (and possibly httpS). Thank you.
    – Jermog
    Jun 16 at 10:46
1

I can't mark a comment as an answer, so I will copy the comment of phils to mark it as a solution.

"I believe you want https for both gnu and melpa, and furthermore that marmalade may no longer be active (I didn't think it was still running, and while the domain is valid, it seemingly doesn't have a current certificate). You would rarely want to prefer http when https was supported."

The working configuration is therefore:

(setq package-archives                                                                                                                                                                                     
      '(("gnu" . "https://elpa.gnu.org/packages/")                                                                                                                                                          
        ("melpa" . "https://melpa.org/packages/"))) 
0

I found I also needed the below:

gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"

Edit: I have since lost the site that I have found this. When I would try and issue a package-list-packages command it would hang and eventually time out. The person indicated that the packages site now requires TLS 1.3 and to add that line. Since then when I update my package list it does not hang.

I believe I found it here: https://stackoverflow.com/questions/55084969/emacs-listing-packages-error-in-process-sentinel

4
  • You mean I need to M-x it as S expression or to add it to init.el?
    – Jermog
    Jun 16 at 10:36
  • I added it in init.el as: (custom-set-variables '(gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") )
    – JonF
    Jun 16 at 10:54
  • I have a feeling this was the expression I used initially, which caused issues in the first place. Maybe, using it caused problems with Marmelade.
    – Jermog
    Jun 16 at 11:03
  • 1
    You also needed this to do what exactly? Please expand your answer to explain what goes wrong without this.
    – NickD
    Jun 16 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.