How do I find the reverse dependency of a package?
I was wondering if it was possible to check what package another package is a dependency of.
For example, jetty is mysteriously installed and running on my system and I’d like to check whether it is a dependency of something else.
You can use apt-cache rdepends --installed jetty
to see what depends on jetty. This will show both depends & recommends, so you may want to check through the list of packages to see what the relationship is with jetty.
If you open Synaptic and find the package, you can right click on it and select Properties.
Under the tab Dependencies you can see the packages that jetty depend on, and which packages is dependent on jetty (the dropdown list).
Go install apt-rdepends
. It doesn’t only show immediate dependencies, but all the recursive ones, so will tend to give you a large output. So, use a pager as well.
- To display recursive depends:
$ apt-rdepends jetty | pager
. Note that this will list exactly the same depends multiple times. Output ofapt-rdepends
1.3.0 isn’t trivial for scripting as package name doesn’t appear along each line… - To display recursive reverse depends:
$ apt-rdepends --reverse jetty | pager
. Note that this will return all packages, not just installed…