Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install by following README instructions #704

Closed
tibbe opened this issue Jun 7, 2015 · 4 comments
Closed

Can't install by following README instructions #704

tibbe opened this issue Jun 7, 2015 · 4 comments

Comments

@tibbe
Copy link
Member

tibbe commented Jun 7, 2015

I'm unable to find the haskell-mode package when using package-install. I have this in my init:

;; Packages
(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "http://stable.melpa.org/packages/"))

(defvar my-packages '(git-commit-mode markdown-mode protobuf-mode
                      better-defaults magit ido-ubiquitous
                                      yasnippet haskell-mode ghc smex
                                      exec-path-from-shell haskell-mode))
(package-initialize)
(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

A manual package content refresh and package-install doesn't list the package either.

@tibbe
Copy link
Member Author

tibbe commented Jun 7, 2015

Could it be because it's already installed?

@tibbe
Copy link
Member Author

tibbe commented Jun 7, 2015

That seems to be it. Confusingly package-install claims a package doesn't exist if it's installed.

@tibbe tibbe closed this as completed Jun 7, 2015
@geraldus
Copy link
Contributor

geraldus commented Jun 7, 2015

Packages that already installed are listed at the bottom, the default order is available packages, installed packages and finally built-in packages. Can you find haskell-mode there?

I've faced some issues with package list, finally I've got it to work properly having following config

(require 'package)
(add-to-list 'package-archives
  '("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)

;; custom load-path locations goes here

Note, I'm not using MELPA stable.

@geraldus
Copy link
Contributor

geraldus commented Jun 7, 2015

Oh, and I believe you need to invoke package-refresh-contents when checking installed pacakges:

(defun g/packages-installed-p ()
  "Determine if all packages are installed."
  (cl-loop for pkg in g/packages
           when (not (package-installed-p pkg)) do (cl-return nil)
           finally (cl-return t)))

(unless (g/packages-installed-p)
  (message "%s" "Refreshing packages database…")
  (package-refresh-contents)
  (dolist (pkg g/packages)
    (when (not (package-installed-p pkg))
      (package-install pkg))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants