Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install MELPA packages via El-Get?

The El-Get documentation says that El-Get supports package.el and the MELPA documentation shows how to use MELPA with package.el. How do I install MELPA packages using El-Get?

Failed Attempt

I'm using Emacs 23, so package.el is not part of Emacs. I installed package.el using El-Get, but I'm not sure how to make El-Get aware of MELPA. I tried adding

;; Based on http://melpa.milkbox.net/#/getting-started .

(require 'package)
(add-to-list 'package-archives
  ;; The 't' means to append, so that MELPA comes after the more
  ;; stable ELPA archive.
  '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; Add ELPA if necessary. Looking at the El-Get package.rcp recipe in
;; ~/local/opt/el-get/recipes it seems this is probably unnecessary.
(when (< emacs-major-version 24)
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))

(package-initialize)

to my init-package.el which is sourced by El-Get, but I still don't see the MELPA packages in El-Get (e.g. with M-x el-get-list-packages).

Update

I added

(require 'el-get-elpa)
;; Build the El-Get copy of the package.el packages if we have not
;; built it before.  Will have to look into updating later ...
(unless (file-directory-p el-get-recipe-path-elpa)
  (el-get-elpa-build-local-recipes))

to my init-package.el as suggested in the accepted answer and now everything works.

like image 919
ntc2 Avatar asked Apr 19 '14 02:04

ntc2


People also ask

How do I update melpa packages?

Updating PackagesAfter running package-list-packages , type U (mark Upgradable packages) and then x (eXecute the installs and deletions).

How do I install Emacs modes?

Type M-x list-packages to open the package list. Press 'i' to mark for installation, 'u' to unmark, and 'x' to perform the installation. Press 'RET' to read more about installing and using each package.

Where are packages installed Emacs?

Once installed, the contents of a package are placed in a subdirectory of ~/. emacs. d/elpa/ (you can change the name of that directory by changing the variable package-user-dir ). The package subdirectory is named name - version , where name is the package name and version is its version string.


1 Answers

Try this:

(require 'el-get-elpa)

and then call M-x el-get-elpa-build-local-recipes: it creates special directory ../recipes/elpa with recipes from elpa and el-get sees new recipes now.

like image 83
artscan Avatar answered Oct 04 '22 04:10

artscan