Answering package dependency questions using apt-cache and apt-rdepends

I often find myself asking the same questions about package dependencies. It can sometimes be confusing to remember which command answers which question due to the similarity of the commands. These are the common questions:

  • Which packages does this package directly depend on?
    • apt-cache depends packagename
  • Which packages directly depend on this package?
    • apt-cache rdepends packagename
    • In this case “rdepends” = reverse dependencies
  • What are all the packages this package depends on?
    • apt-rdepends packagename
    • In this case “rdepends” = recursive dependencies
  • What are all the packages which depend on this package?
    • apt-rdepends -r packagename
    • In this case “rdepends” = recursive dependencies and -r = reverse

The apt-rdepends program can be found in the apt-rdepends package. It’s also worth nothing that apt-rdepends is not perfect and some of its limitations are listed in its man page.

Trackback URL for this post:

http://hightechsorcery.com/trackback/118
Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License