I am working on Debian 10 with Emacs installed from official Debian repositories (ver 1:26.1+1-3.2) and using the following code I cannot connect to synchronize packages available on MELPA: Here's my init file:

(require 'package) 

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


(unless package-archive-contents

(setq my-package-list '(use-package))

(dolist (package my-package-list)
  (unless (package-installed-p package)
    (package-install package)))


Whatever I do, I keep obtaining:

 "Package 'use-package-' is unavailable" 

I checked ~/.emacs.d/elpa/archives and I have no melpa directory in it, only gnu and org.

On the other hand I can fetch melpa's repositories via:

 curl https://melpa.org/packages/archive-contents

I can also use melpa with the use of straight.el, for example via this code:

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
         'silent 'inhibit-cookies)
      (goto-char (point-max))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)

But as far as I can see straight.el fetches MELPA repository on its own.

What is wrong with the original code? What can I do to track the problem?

  • Melpa redirects HTTP to HTTPS, thus if Emacs's url.el can't handle HTTPS, Melpa won't work. straight.el doesn't use any ELPA. ELPA is used by package.el, the builtin package manager, and straight.el is another package manager which does not need ELPA.
    – xuchunyang
    Commented Nov 5, 2020 at 19:14
  • The error you get suggests that you've passed a string "use-package", rather than a symbol (i.e., 'use-package), the function install-package. However, your code looks correct, and it works as expected for me. Is it possible there's been a copy/paste error somewhere?
    – Tyler
    Commented Nov 5, 2020 at 19:21
  • @ Tyler: I'm sure there's no copy/paste error. Commented Nov 5, 2020 at 20:22
  • @xuchunyang: Do you suggest that first I should do something about url.el before going to package initialization and refresh? Simple changing "http ://melpa.org/packages/" to "https ://melpa.org/packages/" does not work. Commented Nov 5, 2020 at 20:22
  • @BothOfYou :): When I start emacs with the original version of init.el, I obtain the following message: Buffer " http melpa.org:443" has a running process; kill it? (yes or no) Commented Nov 5, 2020 at 20:23

1 Answer 1


OK. It's not really an answer to my question. It's only a workaround that I found here as a workaround to a similar problem (maybe even the same?) and it works for me. So I just replaced

("melpa" . "http://melpa.org/packages/")


("melpa" . "https://raw.githubusercontent.com/d12frosted/elpa-mirror/master/melpa/")

and now init file is processed and use-package is installed.

But still, anyone who knows the solution to the problem is wanted... alive...

  • 1
    See this: emacs.stackexchange.com/questions/61547/… - it is the same problem.
    – Ian
    Commented Nov 9, 2020 at 14:21
  • Yes, You're right. A few moments ago I found independently the very same reason of undesirable working of Emacs and I was just about to write about it... The description of the problem and several ways of dealing with it can be found here. Personally, I decided to use AppImage version of Emacs 27.1 and this did the trick. Commented Nov 9, 2020 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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