4

I have scripts to setup virtual machine images, where emacs packages are installed for the root account. Currently, I manually copy them to the appropriate site-lisp directory, i.e. one of those defined by package-directory-list -- either /usr/share/emacs/24.3/site-lisp/elpa or /usr/share/emacs/site-lisp/elpa.

While the above approach works for making installed packages accessible to normal user account, I would prefer to avoid hand editing the packages directory.

Is there a way to automate this process in package.el itself ?

Malabarba
  • 22,878
  • 6
  • 78
  • 163
Ben Hyde
  • 574
  • 3
  • 9
  • 1
    I feel like there is a useful question in here somewhere, but as stated it's unclear. – shosti Oct 14 '14 at 18:45
  • I edited the question quite liberally to emphasize what I think is your question. Feel free to revert/edit if you disagree. The original question was unclear – Vamsi Oct 14 '14 at 19:53

1 Answers1

2

Would it help to simply set package-user-dir before installing the packages?

(setq package-user-dir "/usr/share/emacs/24.3/site-lisp/elpa")

Assuming you have write access, package.el will install the packages there.

Malabarba
  • 22,878
  • 6
  • 78
  • 163