Getting started

Installing

To use the MELPA repository, you'll need an Emacs with package.el. Emacs 24 has package.el bundled with it, and there's also a version you can use with Emacs 23.

Enable installation of packages from MELPA by adding an entry to package-archives after (require 'package) and before the call to package-initialize in your init.el or .emacs file:

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line

or to add the stable package repository, use this instead of "melpa":

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

Customizations

What if you only want some of your packages to be installed from MELPA, and the rest from Marmalade or elsewhere?

Only in the very latest Emacs snapshots is there a way to exclude or include versions according to their source (see package-pinned-packages). For all other users, we provide a package-filter.el package (available in MELPA) that will allow you to enable only certain packages or exclude certain packages. You can install the package manually by pasting this into your *scratch* buffer and evaluating it.

(progn
  (switch-to-buffer
    (url-retrieve-synchronously
      "https://raw.github.com/milkypostman/package-filter/master/package-filter.el"))
  (package-install-from-buffer  (package-buffer-info) 'single))

You can then customize two variables:

package-archive-enable-alist

Optional Alist of enabled packages used by package-filter. The format is (ARCHIVE . PACKAGE ...), where ARCHIVE is a string matching an archive name inpackage-archives, PACKAGE is a symbol of a package in ARCHIVE to enable.

If no ARCHIVE exists in the alist, all packages are enabled.

package-archive-exclude-alist

Alist of packages excluded by package-filter . The format is (ARCHIVE . PACKAGE ...), where ARCHIVE is a string matching an archive name inpackage-archives, PACKAGE is a symbol of a package in that archive to exclude.

Any specified package is excluded regardless of the value of package-archive-enable-alist

Known Issues

Note: These fixes are included in the package-filter.el package.

There is a small bug in Emacs24’s package.el such that the dependency order comes out backwards. The problem is patched by some advice.

 (defadvice package-compute-transaction
  (before package-compute-transaction-reverse (package-list requirements) activate compile)
    "reverse the requirements"
    (setq requirements (reverse requirements))
    (print requirements))

Updating Packages

package.el now includes a mechanism to upgrade packages. After running package-list-packages, type U (mark Upgradable packages) and then x (eXecute the installs and deletions). When it’s done installing all the packages it will ask if you want to delete the obsolete packages and so you can hit y (Yes).

If you run into a problem installing or upgrading, you may need to go into your ~/.emacs.d/elpa/ directory and delete packages that are installed multiple times. This can happen when the install times out.

Development

https://github.com/milkypostman/melpa

Contributions are welcome. Currently, the builder supports packages using git, subversion, mercurial, bzr, cvs, darcs, fossil and emacswiki.