I am encountering a peculiar issue with Emacs's package management system where it is falsely recommending the removal of packages that I have explicitly installed via package-install. One such example is the markdown-mode package.

I have installed the affected packages explicitly using M-x package-install, so they are not dependencies.

I am using Emacs's built-in package.el for package management.

This behaviour is consistent and affects packages that I want to keep.

The recommendation for removal occurs when I go to the list of packages (M-x list-packages) and press capital "U" to update packages. Emacs then prompts me to update the packages and recommends certain packages for removal, even though I want to keep them.

I have checked the usual scenarios such as package dependencies and made sure I am using the correct installation method. I am unable to identify why this is happening.

This thread provides a workaround but does not explain why the package is excluded or indicate that it is a problem that will be rectified:

How does package-autoremove decide which packages to remove?

Why is Emacs recommending the removal of these explicitly installed packages, and is this behaviour which I have observed for a long time going to be fixed?

Emacs Version: 30

Any insights or guidance on this issue would be greatly appreciated!

  • I believe I have seen that behavior but I have not stopped to investigate further. A bug report (M-x report-emacs-bug) is probably a good idea, if only to get an explanation of why this happens.
    – NickD
    Aug 4, 2023 at 14:15
  • Maybe M-x report-emacs-bug?
    – Drew
    Aug 4, 2023 at 15:06
  • Did you check the value of the package-selected-packages variable as suggested in the other question? Including the value in your own question will clarify the matter.
    – db48x
    Aug 4, 2023 at 19:41
  • I did check the value. The packages listed do not correspond to those in my .emacs.d folder under elpa. Packages are listed that have been uninstalled, and at least one installed package is not listed there, the same package package-autoremove wishes to remove.
    – Edman
    Aug 5, 2023 at 5:21
  • Then you already have the answer: add the package that you don’t want it to autoremove to the list.
    – db48x
    Aug 5, 2023 at 13:34


Your Answer

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

Browse other questions tagged or ask your own question.