Installation

1 Installing from an Elpa Archive

use-package is available from Melpa and Melpa-Stable. If you haven’t used Emacs’ package manager before, then it is high time you familiarize yourself with it by reading the documentation in the Emacs manual, see . Then add one of the archives to package-archives:

  • To use Melpa:
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
  • To use Melpa-Stable:
(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

Once you have added your preferred archive, you need to update the local package list using:

M-x package-refresh-contents RET

Once you have done that, you can install use-package and its dependencies using:

M-x package-install RET use-package RET

Now see 3.

2 Installing from the Git Repository

First, use Git to clone the use-package repository:

$ git clone https://github.com/jwiegley/use-package.git ~/.emacs.d/site-lisp/use-package
$ cd ~/.emacs.d/site-lisp/use-package

Then compile the libraries and generate the info manuals:

$ make

You may need to create /path/to/use-package/config.mk with the following content before running make:

LOAD_PATH  = -L /path/to/use-package

Finally add this to your init file:

(add-to-list 'load-path "~/.emacs.d/site-lisp/use-package")
(require 'use-package)

(with-eval-after-load 'info
  (info-initialize)
  (add-to-list 'Info-directory-list
               "~/.emacs.d/site-lisp/use-package/"))

Note that elements of load-path should not end with a slash, while those of Info-directory-list should.

Instead of running use-package directly from the repository by adding it to the load-path, you might want to instead install it in some other directory using sudo make install and setting load-path accordingly.

To update use-package use:

$ git pull
$ make

At times it might be necessary to run make clean all instead.

To view all available targets use make help.

Now see 3.

3 Post-Installation Tasks

After installing use-package you should verify that you are indeed using the use-package release you think you are using. It’s best to restart Emacs before doing so, to make sure you are not using an outdated value for load-path.

C-h v use-package-version RET

should display something like

use-package-version’s value is "2.4"

If you are completely new to use-package then see Getting Started.

If you run into problems, then please see the FAQ. Also see the Debugging Tools.