User-agent: mu4e 1.1.0; emacs 27.0.50 The package-autoremove machinery assumes all packages which are not user-selected are removable (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27822) However this is blatantly untrue. For example, in debian unstable, emacs packages can be installed system-wide via apt as well (see all the elpa-* packages). Such packages _cannot_ and shouldn't be auto-removed. The following patch checks whether a package has been _directly_ installed into `package-user-dir' before marking it eligible for auto-removal. [copyright assignment already done]