13

I tried to delete package X (in order to try an older built-in version). But when I restart emacs, it's automatically re-installed. package-list-packages lists it as a dependency so that behaviour seems reasonable, actually quite smart. The trouble is, I can't see what other package has created the dependency. I've tried visiting all the 'installed' and most of the 'dependency' packages in (package|paradox)-list-packages but X does not show up as a dependency.

I'd prefer to know how to find out this information, but X is org-plus-contrib-20181230 (I won't be uninstalling this permanently, it's just curiosity).

2
  • 1
    Use M-x package-delete to delete the package, and it will tell you what package depends on it.
    – paulie4
    Jul 12, 2021 at 14:24
  • Duh! Of course - you're right. That's (rpm -e <pkg>) what I used to do with RPM before I discovered --whatrequires. Thanks for pointing it out.
    – wef
    Jul 13, 2021 at 22:08

2 Answers 2

3

All packages are in ~/.emacs.d/elpa
Package dependencies are listed in files ending with "-pkg.el" in each package directory.

To find which packages require some package, find "-pkg.el"'s that contain that package's name.

Using M-x rgrep:

Example: find all packages that require "popup" package.

M-x rgrep prompts:

Search for:

Each dependency is in a list, so the name starts with a "(", then goes package name, one or more spaces, and a double quote(") of a version string.
So, use basic regular expression to find a string in this format: (popup "

Search for: (popup \+"
Search for "(popup \+"" in files matching wildcard: *pkg.el
Base directory: /home/somename/.emacs.d/elpa/

Result:

A *grep* buffer with links to all packages that depend on popup.

UPD

In such situations just M-x rgrep everything.
I grepped all my Emacs installation for a "contrib" word. And there' a NEWS org file that logs all changes in new versions.
In version 7.9.2, about that "//orgmode.org/elpa/":

You can now add the Org ELPA repository like this:

(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)

It contains both the =org-.tar= package (the core Org distribution, also available through https://elpa.gnu.org) and the =org-plus.tar= package (the extended Org distribution, with non-GNU packages from the =contrib/= directory.)

3
  • Works nicely - thanks for the code and the theory. In my case, popup is a dependency of dumb-jump. Unfortunately, org-plus-contrib is not a dependency of anything after all! So there is some other reason that it keeps getting installed. It's not a problem as I normally want it, it's just something else that I don't quite understand!!!
    – wef
    Jan 13, 2019 at 5:46
  • @wef Strange thing, I don't know where that org-plus-contrib comes from. It's not on MELPA, not on github. Jan 13, 2019 at 11:29
  • 1
    Alex - it's from org-mode's own package repo by the look of it. My config (derived from ohai-emacs) includes these: (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) - confusingly, the (built-in?) gnu repo has an 'org' package at version 20181230 and the org-mode repo has org-plus-contrib at the same version. I'm trying a virgin .emacs.d and building enough to install a few packages but I haven't been able to trigger the org-plus-contrib installation yet.
    – wef
    Jan 13, 2019 at 11:59
1

Another reason a package might be listed as a dependency is because it is in ~/.emacs.d/elpa, but not in package-selected-packages. One possible way to reach that state is install a newer version of a package, notice it, and delete one of them.

Your Answer

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

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