(Originally I posted the information here as a reply in another thread. I've moved it to a separate thread because I think it's pretty damn neat and I'm hoping this will enhance discoverability.)
The apt-rdepends command performs recursive dependency listings similar to apt-cache. However, whereas the "rdepends" in apt-cache means reverse depends, the "rdepends" in apt-rdepends means recursive depends. To confuse you even further, apt-rdepends can be run in both forward and, uh, reverse modes!
The Hartwork Blog has a very cool post illustrating how to use apt-rdepends to generate graphical dependency maps.
To generate a forward dependency graph for any package, type the following at a console prompt:
i=package-name; apt-rdepends -d $i | dot -Tpng > $i.png
This creates a graphical image of recursive forward dependencies. Blue lines are pre-depends, green lines are conflicts, yellow lines are suggests, orange lines are recommends, red lines are replaces, and black lines are depends. Here's the output of that using libakonadi-kabc4:
To generate a reverse dependency graph of any package, use this variation:
i=package-name; apt-rdepends -dr $i | dot -Tpng > $i-r.png
The differences: an "r" after the "-d" (tells apt-rdepends to run in reverse) and a "-r" to the output filename (just my convention). Here's the result of running that with dolphin:
They say a picture is worth a thousand words. Well, now we have a way to turn a thousand words into a picture. I hope you find this a useful tool. I certainly have.
The apt-rdepends command performs recursive dependency listings similar to apt-cache. However, whereas the "rdepends" in apt-cache means reverse depends, the "rdepends" in apt-rdepends means recursive depends. To confuse you even further, apt-rdepends can be run in both forward and, uh, reverse modes!
The Hartwork Blog has a very cool post illustrating how to use apt-rdepends to generate graphical dependency maps.
To generate a forward dependency graph for any package, type the following at a console prompt:
i=package-name; apt-rdepends -d $i | dot -Tpng > $i.png
This creates a graphical image of recursive forward dependencies. Blue lines are pre-depends, green lines are conflicts, yellow lines are suggests, orange lines are recommends, red lines are replaces, and black lines are depends. Here's the output of that using libakonadi-kabc4:
To generate a reverse dependency graph of any package, use this variation:
i=package-name; apt-rdepends -dr $i | dot -Tpng > $i-r.png
The differences: an "r" after the "-d" (tells apt-rdepends to run in reverse) and a "-r" to the output filename (just my convention). Here's the result of running that with dolphin:
They say a picture is worth a thousand words. Well, now we have a way to turn a thousand words into a picture. I hope you find this a useful tool. I certainly have.
Comment