How to list dependent packages (reverse dependencies)?
In order to research what caused the installation of a given package, I'd like to get a list of packages which depend on that package. I couldn't find anything obvious in man dpkg.
7 Answers
apt-cache rdepends packagename should do what you want
aptitude has a fairly nice way of handling this:
$ aptitude why bash
i foomatic-filters PreDepends bash (>= 2.05)By default, it only lists the "most installed, strongest, tightest, shortest" reason, but you can use aptitude -v why to make it output everything it finds.
apt-cache showpkg <pkgname> Example:
apt-cache showpkg lightdm 2 The simplest option is still:
apt rdepends package-namewhich does not require you to install any package.
4There is more than one way, with each method showing a different output.
For a detailed view of the full reverse dependency tree;
aptitude install apt-rdepends
apt-rdepends -r bashAlternatively;
apt-cache showpkg bashOr a concise list:
apt-cache rdepends bash 4 In addition to other good answers, an apt/apt-get -s does a "simulated" removal (or install).
sudo apt -s remove <pkgname>Using -s or --simulate to remove (or install) packages, will normally list any dependencies affected. It will show orphaned packages when removing, or needed dependencies when installing, without actually executing the install or remove. Informational only.
With the reverse-depends command from the package: ubuntu-dev-tools
reverse-depends libjs-openlayers
# For build depends search
reverse-depends -b libjs-openlayersReverse-Recommends
* gis-osm
Reverse-Depends
* cyclograph
* phpmyadmin
* sumo-tools
Packages without architectures listed are reverse-dependencies in: amd64, arm64, armhf, i386, ppc64el, s390x