Via the Package Menu, users may download packages from package
archives. Such archives are specified by the variable
package-archives, whose default value contains a single entry:
the archive hosted by the GNU project at elpa.gnu.org. This
section describes how to set up and maintain a package archive.
The value of this variable is an alist of package archives recognized by the Emacs package manager.
Each alist element corresponds to one archive, and should have the form
), where id is the name of the archive (a string) and location is its base location (a string).
If the base location starts with ‘http:’, it is treated as a HTTP URL, and packages are downloaded from this archive via HTTP (as is the case for the default GNU archive).
Otherwise, the base location should be a directory name. In this case, Emacs retrieves packages from this archive via ordinary file access. Such “local” archives are mainly useful for testing.
A package archive is simply a directory in which the package files, and associated files, are stored. If you want the archive to be reachable via HTTP, this directory must be accessible to a web server. How to accomplish this is beyond the scope of this manual.
A convenient way to set up and update a package archive is via the
package-x library. This is included with Emacs, but not loaded
by default; type M-x load-library <RET> package-x <RET> to
load it, or add
(require 'package-x) to your init file.
See Lisp Libraries.
Once loaded, you can make use of the following:
The value of this variable is the base location of a package archive, as a directory name. The commands in the
package-xlibrary will use this base location.
The directory name should be absolute. You may specify a remote name, such as /ssh:firstname.lastname@example.org:/var/www/packages/, if the package archive is on a different machine. See Remote Files.
This command prompts for filename, a file name, and uploads that file to
package-archive-upload-base. The file must be either a simple package (a .el file) or a multi-file package (a .tar file); otherwise, an error is raised. The package attributes are automatically extracted, and the archive's contents list is updated with this information.
package-archive-upload-basedoes not specify a valid directory, the function prompts interactively for one. If the directory does not exist, it is created. The directory need not have any initial contents (i.e., you can use this command to populate an initially empty archive).
This command is similar to
package-upload-file, but instead of prompting for a package file, it uploads the contents of the current buffer. The current buffer must be visiting a simple package (a .el file) or a multi-file package (a .tar file); otherwise, an error is raised.
After you create an archive, remember that it is not accessible in the
Package Menu interface unless it is in