How to remove installed elpa package

Emacs

Emacs Problem Overview


This is strange, the list-packages buffer shows "available" as the status for some packages that are actually installed. Shouldn't that column show "installed" for them? When I click on one, a new buffer opens to inform me that the package is installed, but offers no uninstall option. By comparison, other packages I do not have installed show as "available" with an "install" option next to them.

How do I uninstall an installed package? The one I'm currently looking to axe is smooth-scrolling.

Emacs Solutions


Solution 1 - Emacs

The package menu shows all known versions of a package.

As such, you may see an installed package listed as available as well, for instance, if there is a newer version of the same package available, or if the same package is available from different archives.

To delete such a package, simply scroll down in the list, or use C-s <PACKAGE-NAME> to search for occurrences of the package. 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.

Solution 2 - Emacs

I like to use the poor's man solution for that: just remove the directory for the unwanted package in ~/.emacs.d/elpa/ (or the directory specified in your package-directory-list).

EDIT: this solution is intended for scenarios where something went wrong (maybe a bug, maybe the result of manual tinkering with packages' data). Please use @lunaryon answer; it is the right way of doing this on the 99.9% of the cases.

Solution 3 - Emacs

For Emacs 25.1 and above, the command

M-x package-delete

raises a prompt with autocompletion into names of packages you have got installed.

Solution 4 - Emacs

I've just uninstalled django-snippets packages by

M-x package-list-packages
C-s django-snippets

Mark the package for deletion by typing d. Execute by typing x.

Exactly the same thing as removing the related directory inside ~/.emacs.d/elpa/.

NB, for the recent emacs, the command is list-packages (instead of packages-list-packages)

Solution 5 - Emacs

I found it by chance: bring on the package list, find the package(s) you want to remove, and press 'D'. When you are done, press 'X' and it will remove the packages. It works exactly like when installing new packages, except that you replace the 'I' by 'D' (I think 'D' stands for 'delete').

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjohnbakersView Question on Stackoverflow
Solution 1 - EmacslunaryornView Answer on Stackoverflow
Solution 2 - EmacsjuanleonView Answer on Stackoverflow
Solution 3 - EmacsmmwView Answer on Stackoverflow
Solution 4 - EmacsNsukami _View Answer on Stackoverflow
Solution 5 - EmacsS4MView Answer on Stackoverflow