69

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.

1

5 Answers 5

59

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.

3
  • 5
    It should be noted that this is only the case with Emacs 25.1+
    – npostavs
    Apr 3, 2017 at 14:49
  • I still had to delete the package directory in ~/.emacs.d/elpa/... for the package to not be loaded at next Emacs restart. Mar 24, 2020 at 16:18
  • Refuses to work because of dependencies.
    – ceving
    Jan 7 at 16:59
57

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.

5
  • 1
    the problem is that when I press D there is no mark next to it, even though it is installed.
    – johnbakers
    Dec 12, 2013 at 13:03
  • 1
    @OpenLearner Did you press D on the package version marked as installed? It won't work on the version marked as available.
    – user355252
    Dec 12, 2013 at 13:39
  • none of them show as "installed" in the actual column in the list, even though this package is in fact installed and says so when you click on it.
    – johnbakers
    Dec 12, 2013 at 13:43
  • Not sure, but it sounds like there is an Emacs bug here, or at least room for an enhancement request, to make the UI clearer. If you think so, consider reporting it, via M-x report-emacs-bug.
    – Drew
    Dec 12, 2013 at 17:11
  • 4
    @OpenLearner scroll to end to get installed sign, you may find latest version of this package which is not installed, besides, press d instead D
    – netawater
    Jun 5, 2015 at 8:41
51

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.

4
  • 1
    my concern for this is that isn't there another file somewhere showing what is installed, that would not be a part of the directory itself? Surely emacs must know what it is supposed to load if that information is not always in the .emacs file
    – johnbakers
    Dec 12, 2013 at 13:01
  • 6
    There is no such file. package-initialize scans your configured directories in package-directory-list for packages. package-load-list is used, and autoloads do the "magic" part. Typically what @lunaryorn suggests should do the job, but removing the directory is a safe alternative when you find problems.
    – juanleon
    Dec 12, 2013 at 13:16
  • thanks! I installed package-filter.el, then just found lots of things got broken, including the package manager, so no d -> x nor anything, except this solution.
    – ryenus
    Nov 11, 2014 at 13:13
  • My variable custom-set-variables in init.el also has some settings about the package I want to remove. "If you edit it by hand, you could mess it up, so be careful", it says.
    – Gauthier
    Jun 8, 2017 at 6:46
24

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)

1
  • 1
    Just a minor thing - it's package-list-packages I believe.
    – davidA
    Dec 3, 2018 at 7:11
14

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').

2
  • 1
    F10 to check the Package menu: Mark for Install (i) Mark for Deletion (d) Execute Marked Options (x)
    – xiaobing
    Sep 28, 2017 at 12:14
  • D is undefined
    – alper
    Jul 14, 2020 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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