1

Currently I am experimenting with Emacs and playing with many el files. Sometimes packages are installed from those el files or I install with a command M-x package-install. But this may cause trouble in the future if I want to replicate my emacs configuration in other computers. Is there a way to keep informed which packages installed in my system and save them in one file automatically?

2

Packages installed with package-install are stored under .emacs.d/elpa/ directory. You can remove a package by deleting its directory e.g. evil-20170802.1333 ;)

Check out use-package package. It provides a very useful macro:

(use-package my-favourite-package
  :ensure t)

This piece of code placed in init.el will install that package if it's not installed already, so you can simply move your init.el to another machine and the package will be installed automatically during startup.

There are some preparatory steps required for this to work (i.e. ensuring that use-package itself is installed and present), so find and follow a tutorial on use-package.

  • 1
    This is very useful, but just to be clear, this is declarative (you say what packages to install), not inquisitive. You won't be able to use use-package to replicate all the installed packages on your current system unless you find out what they are and set them up in use-package. – zck Aug 28 '17 at 15:36

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.