Announcement

Collapse
No announcement yet.

Graphical dependency mapping

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Graphical dependency mapping

    (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.

    #2
    Re: Graphical dependency mapping

    That's neat.

    I just discovered the debtree command a few days ago, and couldn't wait to try it:

    debtree gimp | dot -Tsvg >gimp.svg

    I have to say, in all honesty, that this is about the most useless thing I have yet done with the system. Good for a laugh, though. See attached for proof of that point (converted to pdf as the board won't allow svg).

    Maybe your method will work better.

    Edit: i did think of a use for this. You could print it out, stick it on your front door, and scare away all the trick-or-treaters on halloween. Then you get to keep all the candy.
    Attached Files
    We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

    Comment


      #3
      Re: Graphical dependency mapping

      I suppose it should come as no surprise that if there's one way to do something in Linux, there's at least 42 other ways.

      Running gimp through apt-rdepends produces an output that's actually uglier than that from debtree.

      I'm curious why you think it's useless...there've been times where I've trawled through hand-written dependency trees trying to track down something or other. I wish I would have known about apt-rdepends then, because the pretty pictures would have helped.

      Comment


        #4
        Re: Graphical dependency mapping

        Originally posted by SteveRiley
        ...
        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.
        Easily a thousand words.... This is cool. I knew about apt-cache rdepends and have used it several times. Being able to consult a dependency graph makes relationships a LOT clearer than looking at a vertical list of apps.

        Thanks for the tip. The next time someone has a dependency problem while updating ....
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Re: Graphical dependency mapping

          I'm curious why you think it's useless
          I meant that with a dose of humor. I don't think anyone could reasonably expect to sort out dependencies for something like gimp (or LO) this way. The lines all merge, therefore it's impossible to trace things out.

          For simpler programs, doing a graphical dependency tree really is quite useful, in a way that a terminal command spewing out pages of text is not.
          We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

          Comment


            #6
            Re: Graphical dependency mapping

            I love it! I fully understand what Druid is saying, yet to me I have trouble to remember blocks of text. Visualizations are much easier for me to remember - GIMPed or not, this is the way I (my mind) work, and this could be a useful tool ... if I only could remember the command
            ASUS M4A87TD | AMD Ph II x6 | 12 GB ram | MSI GeForce GTX 560 Ti (448 Cuda cores)
            Kubuntu 12.04 KDE 4.9.x (x86_64) - Debian "Squeeze" KDE 4.(5x) (x86_64)
            Acer TimelineX 4820 TG | intel i3 | 4 GB ram| ATI Radeon HD 5600
            Kubuntu 12.10 KDE 4.10 (x86_64) - OpenSUSE 12.3 KDE 4.10 (x86_64)
            - Officially free from windoze since 11 dec 2009
            >>>>>>>>>>>> Support KFN <<<<<<<<<<<<<

            Comment


              #7
              Re: Graphical dependency mapping

              Originally posted by Jonas
              if I only could remember the command
              You could always write short shell scripts for them. Call the forward grapher whatitneeds and call the reverse grapher whatneedsit.

              Comment


                #8
                Re: Graphical dependency mapping

                Originally posted by doctordruidphd
                I meant that with a dose of humor. I don't think anyone could reasonably expect to sort out dependencies for something like gimp (or LO) this way. The lines all merge, therefore it's impossible to trace things out.
                True, that.

                Perhaps we should run a little contest: let's see who can discover the prettiest dependency graph. Jerry, would you mind being our judge?

                Comment


                  #9
                  Re: Graphical dependency mapping

                  With pleasure!
                  (Extra points for creating a PDF!)
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #10
                    nice
                    my brain would blow up if i tried to keep my thought as neat as you do ))))

                    Comment


                      #11
                      What I'm wondering is if it will give us the ability to both travel to see a Star Trek movie marathon and also travel to another location to get our favourite Icee drink and not miss the start of the movie.

                      woodsmoke

                      Comment


                        #12
                        Originally posted by doctordruidphd View Post
                        That's neat.

                        I just discovered the debtree command a few days ago, and couldn't wait to try it:

                        debtree gimp | dot -Tsvg >gimp.svg

                        I have to say, in all honesty, that this is about the most useless thing I have yet done with the system. Good for a laugh, though. See attached for proof of that point (converted to pdf as the board won't allow svg).

                        Maybe your method will work better.

                        Edit: i did think of a use for this. You could print it out, stick it on your front door, and scare away all the trick-or-treaters on halloween. Then you get to keep all the candy.
                        "This is your PC. This is your PC on drugs.":eek:
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment

                        Working...
                        X