0

I've been switching my .emacs.d to load packages via package.el instead of using gitsubmodules but I'm unable to install magit because emacs-24.4 isn't available. Getting the emacs version gives me:

$ emacs -version   
GNU Emacs 24.5.1
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Is there anything I can do to work around this?

EDIT: Doing (package-install 'magit) in the scratch buffer gives me:

Debugger entered--Lisp error: (error "Package `emacs-24.4' is unavailable")
  signal(error ("Package `emacs-24.4' is unavailable"))
  error("Package `%s-%s' is unavailable" "emacs" "24.4")
  (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version)))
  (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error "Required package '%s' is disabled" (symbol-name next-pkg))) ((null (stringp hold)) (error "Invalid element in `package-load-list'")) ((version-list-< (version-to-list hold) next-version) (error "Package `%s' held at version %s, but version %s required" (symbol-name next-pkg) hold (package-version-join next-version)))))) (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-<= next-version (package-desc-vers (cdr pkg-desc))) nil (error "Need package `%s-%s', but only %s is available" (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc)))))
  (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error "Required package '%s' is disabled" (symbol-name next-pkg))) ((null (stringp hold)) (error "Invalid element in `package-load-list'")) ((version-list-< (version-to-list hold) next-version) (error "Package `%s' held at version %s, but version %s required" (symbol-name next-pkg) hold (package-version-join next-version)))))) (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-<= next-version (package-desc-vers (cdr pkg-desc))) nil (error "Need package `%s-%s', but only %s is available" (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc))))))
  (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error "Required package '%s' is disabled" ...)) ((null ...) (error "Invalid element in `package-load-list'")) ((version-list-< ... next-version) (error "Package `%s' held at version %s, but version %s required" ... hold ...))))) (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-<= next-version (package-desc-vers (cdr pkg-desc))) nil (error "Need package `%s-%s', but only %s is available" (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc)))))))
  (while --dolist-tail-- (setq elt (car --dolist-tail--)) (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond (... ...) (... ...) (... ...)))) (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-<= next-version (package-desc-vers (cdr pkg-desc))) nil (error "Need package `%s-%s', but only %s is available" (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers ...)))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc))))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- requirements) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold ...) (cond ... ... ...))) (if pkg-desc nil (error "Package `%s-%s' is unavailable" (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-<= next-version (package-desc-vers ...)) nil (error "Need package `%s-%s', but only %s is available" (symbol-name next-pkg) (package-version-join next-version) (package-version-join ...))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs ...)))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  package-compute-transaction((magit) ((emacs (24 4)) (async (1 5)) (dash (2 12 1)) (with-editor (2 5 1)) (git-commit (2 6 2)) (magit-popup (2 6 2))))
  (package-download-transaction (package-compute-transaction (list name) (package-desc-reqs (cdr pkg-desc))))
  (let ((pkg-desc (assq name package-archive-contents))) (if pkg-desc nil (error "Package `%s' is not available for installation" (symbol-name name))) (package-download-transaction (package-compute-transaction (list name) (package-desc-reqs (cdr pkg-desc)))))
  package-install(magit)
  eval((package-install (quote magit)) nil)
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp(nil)
  call-interactively(eval-print-last-sexp nil nil)
  command-execute(eval-print-last-sexp)
  • Can you add the exact error message and backtrace? – npostavs Jun 19 '16 at 21:49
  • @npostavs - added – DrugCrazed Jun 19 '16 at 22:25
  • M-x package-refresh-contents ? I think your local data must be well out of date, if the magit package specifies a dependency on 24.4 ? – phils Jun 19 '16 at 22:51
  • 1
    @phils: magit package currently depends on 24.4, see github.com/magit/magit/blob/2.7.0/lisp/magit.el#L19, but Emacs 24.5 should satisfy this (24.4 implicitly means 24.4 or greater) – npostavs Jun 19 '16 at 22:59
  • @DrugCrazed what is your value of package--builtin-versions? It should have (emacs 24 5) in it. – npostavs Jun 19 '16 at 23:04
2

Turns out that I had an old version of package.el in my path which I was loading. Removing that load means I can now install magit fine!

Moral of the story: Make sure you're not including the old versions of core code in your init.el!

  • M-x list-load-path-shadows can be helpful for this (should have thought of that earlier). – npostavs Jun 20 '16 at 21:51

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.