I have a problem with emacs downloading packages and would appreciate some pointers on how this could be tracked/solved.
disclaimers first: I'm a complete noob at emacs, so if something looks/sounds stupid, it most likely is, please let me know.
Note that I'm running this behind a proxy set-up at $work.
I'm trying to set-up an emacs install to use ENSIME for Scala development. On the getting started page they have a sample init.el that is causing me problems:
;; global variables (setq inhibit-startup-screen t create-lockfiles nil make-backup-files nil column-number-mode t scroll-error-top-bottom t show-paren-delay 0.5 use-package-always-ensure t sentence-end-double-space nil) ;; buffer local variables (setq-default indent-tabs-mode nil tab-width 4 c-basic-offset 4) ;; modes (electric-indent-mode 0) ;; global keybindings (global-unset-key (kbd "C-z")) ;; the package manager (require 'package) (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") ("org" . "http://orgmode.org/elpa/") ("melpa" . "http://melpa.org/packages/") ("melpa-stable" . "http://stable.melpa.org/packages/")) package-archive-priorities '(("melpa-stable" . 1))) (package-initialize) (when (not package-archive-contents) (package-refresh-contents) (package-install 'use-package)) (require 'use-package) (use-package ensime :ensure t :pin melpa-stable) When running emacs --debug-init I get the following error:
Debugger entered--Lisp error: (error "Package `use-package-' is unavailable") signal(error ("Package `use-package-' is unavailable")) error("Package `%s-%s' is unavailable" use-package "") package-compute-transaction(nil ((use-package))) package-install(use-package) (progn (package-refresh-contents) (package-install (quote use-package))) (if (not package-archive-contents) (progn (package-refresh-contents) (package-install ($ eval-buffer(#<buffer *load*> nil "/home/ubuntu/.emacs.d/init.el" nil t) ; Reading at $ load-with-code-conversion("/home/ubuntu/.emacs.d/init.el" "/home/ubuntu/.emacs.d/init.e$ load("/home/ubuntu/.emacs.d/init" t t) #[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\3$ command-line() normal-top-level() What I understand from this error is that use-package is not available/installed. Which is weird.
If I do: M-x package-refresh-contents I get this:
Loading 00debian-vars...done Importing package-keyring.gpg...done Using a proxy for http... Contacting host: elpa.gnu.org:80 [2 times] Failed to download `gnu' archive. Contacting host: orgmode.org:80 [2 times] Failed to download `org' archive. Contacting host: melpa.org:80 [2 times] Failed to download `melpa' archive. Contacting host: stable.melpa.org:80 [2 times] Failed to download `melpa-stable' archive. For information about GNU Emacs and the GNU system, type C-h C-a. So it seems that emacs understands that it is behind a proxy, but for some reason it fails the download.
How would I go about finding out the root cause of this and fixing it?
(unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package))