Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rebuild ELPA packages after upgrade of Emacs

Tags:

emacs

elpa

I just upgraded GNU Emacs from 23 to 24 on MacOS and some ELPA installed packages stopped working. One of them is AucTeX. Deleting it and reinstalling it through the package manager made it work again, but I don't want to do this by hand for every package. I'm slightly confused that I find nothing about that on the Internet.

Don't the .elc need to be recompiled for a new version of Emacs? Why isn't this a feature of package.el?

like image 707
Thomas Avatar asked Jul 13 '14 18:07

Thomas


People also ask

How do I update melpa packages?

Updating PackagesAfter running package-list-packages , type U (mark Upgradable packages) and then x (eXecute the installs and deletions). When it's done installing all the packages it will ask if you want to delete the obsolete packages and so you can hit y (Yes).

Where are packages stored Emacs?

Once installed, the contents of a package are placed in a subdirectory of ~/. emacs. d/elpa/ (you can change the name of that directory by changing the variable package-user-dir ). The package subdirectory is named name - version , where name is the package name and version is its version string.

How do I uninstall Emacs packages?

Once you find the installed version of the package, press D to mark the package for deletion; if this fails, press d . You should see a D mark in the left before the package name. Press x to execute the action and actually delete the package.


1 Answers

You do not need to re-install all packages. The packages itself are likely fine, however, they need to be re-compiled, because Emacs Lisp byte code is generally not compatible across major versions.

To re-compile all packages, type M-: (byte-recompile-directory package-user-dir nil 'force). After restarting Emacs, packages should work fine again.

like image 177
lunaryorn Avatar answered Sep 28 '22 01:09

lunaryorn