0

I am following the instructions here to install ghc-mod in Emacs. I can add the melpa repos and list packages with M-x package-list-packages, then when I go to install the ghc package, this happens:

Debugger entered--Lisp error: (error "Error during download request: Not Found")
  signal(error ("Error during download request: Not Found"))
  error("Error during download request:%s" " Not Found")
  package-handle-response()
  package-download-tar(ghc "20141130.1848")
  package-download-transaction((ghc))
  package-install(ghc)
  mapc(package-install (ghc))
  package-menu-execute()
  call-interactively(package-menu-execute nil nil)

In .emacs I have

(require 'package)
;; Add the original Emacs Lisp Package Archive
(add-to-list 'package-archives
         '("elpa" . "http://tromey.com/elpa/"))
; old url for melpa
;(add-to-list 'package-archives
;             '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives 
     '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
;; Add the user-contributed repository
(add-to-list 'package-archives
         '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)

I am using emacs 24.3.1 on ubuntu. How to proceed? Thanks.

[EDIT] I installed this package successfully by downloading it myself but I'd still like to know what's wrong here.

jaybee
  • 1,897
  • 2
  • 16
  • 29

1 Answers1

1

It looks like you may have started working with MELPA (not MELPA stable):

  • You have the MELPA package repository in your .emacs (though commented out), and
  • The traceback shows that you were trying to install version 20141130.1848, which is a MELPA-style timestamp.

But MELPA is disabled in your init file by the commenting. You also have MELPA stable listed, which uses a different versioning scheme based on Git tags instead of on build timestamps. The latest version of ghc in MELPA Stable is currently 5.2.1.2.

I think you may have made this change without running package-refresh-contents, which updates your local package list. (Note that this is often done automatically, e.g. by loading the package list with package-list-packages).

So when you tried to install ghc, based on the stale package list that Emacs had it looked for version 20141130.1848, but could only find version 5.2.1.2. Try again after running M-x package-refresh-contents.

Note that you also have Marmalade enabled, which also contains ghc (version 1.10.2).

Since there is some package overlap between MELPA and Marmalade, I don't recommend using both concurrently. You can manually pin packages to one repository, but this gets to be a pain. I switched to MELPA Stable exclusively a few months ago, and I've been very happy with it.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • What do you suggest I do to fix the problem? – jaybee Jan 11 '15 at 21:36
  • 1
    @jaybee, decide which package repositories you wish to use and ensure that your config uses only these (I recommend MELPA Stable and the standard GNU ELPA). Get rid of `tromey.com`; GNU ELPA should be included by default. Restart Emacs. `M-x package-list-packages` (which should automatically refresh your local package list; you should see "Contacting host..." messages), find `ghc`, and install. – ChrisGPT was on strike Jan 11 '15 at 21:52