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/") )) (package-initialize) (unless package-archive-contents (package-refresh-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:
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) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (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?