Is this something that can / should be done? For example, often I use emacs in my user account and sometimes root account. When using the package manager (i.e marmalade or something) do I have to install the same packages seperately for each account? It seems to me that they get installed in your home directory.
As pointed out by Nsukami, package.el does support system-wide packages. But as your subsequent question points out, it does not provide any special help to install packages in a system-wide manner.
One way you can do that is by using something like:
(setq package-user-dir "/usr/share/emacs/site-lisp/elpa")
in your root account's
~/.emacs. This will make the root user's installed packages available to all users (since
/usr/share/emacs/site-lisp/elpa should normally appear in the default value of
According to the documentation:
package-directory-list's value is
("/usr/local/share/emacs/24.4/site-lisp/elpa" "/usr/local/share/emacs/site-lisp/elpa" "/usr/share/emacs/24.4/site-lisp/elpa" "/usr/share/emacs/site-lisp/elpa")
This variable may be risky if used as a file-local variable.
Documentation: List of additional directories containing Emacs Lisp packages. Each directory name should be absolute.
These directories contain packages intended for system-wide; in contrast, `package-user-dir' contains packages for personal use.
You can customize this variable.
This variable was introduced, or its default value was changed, in version 24.1 of Emacs.
In addition to package-user-dir, Emacs looks for installed packages in the directories listed in package-directory-list. These directories are meant for system administrators to make Emacs packages available system-wide; Emacs itself never installs packages there.
So, for site wide install, I suggest you to, as a system administrator, manually install the packages inside /usr/local/share/emacs/site-lisp/elpa. Or you can also do as suggested by @Stefan