Home > Blog > zypper – dependency graph

zypper – dependency graph
1 star2 stars3 stars4 stars5 stars
(no votes yet)
Loading ... Loading ...

March 24th, 2010 Leave a comment Go to comments

Yesterday, we needed with darix to obtain a dependency graph of the package you are about to install. I knew that something similar was planned in zypper, so I went to Jano Kupec to check the status of it. Unfortunately, I learned that this feature is not implemented yet. I think it should not be very hard to enhance the zypper package list with some eye-candy, but I haven’t looked into it yet. I would love to have these outputs similar to Gentoo ones (colors and simple ASCII art dependency trees). Btw, zypper already has color support, so if you want to start hacking, there is source code in gitorious.

Jano also showed me a neat trick how to obtain the results we wanted anyway. If you are in similar situation, just follow these steps (they are of course not suitable for everyday use, but still better than nothing):

  1. install package libzypp-testsuite-tools
  2. run zypper install --debug-solver pkg
  3. cd into /var/log/zypper.solverTestCase
  4. open solver-test.xml in your favorite editor
  5. add <graphic/> tag just above the </trial> closing tag
  6. run /usr/lib/zypp/testsuite/bin/deptestomatic.multi solver-test.xml (as normal user, you won’t get any graph when running as root)
  7. you can pan the graph, rotate it with the right click or even save it to disk!

The resulting image can be seen here:

  1. March 24th, 2010 at 21:00 | #1 | Firefox 3.5.8openSUSE

    I have some problems:

    # zypper install –debug-solver pkg
    Loading repository data…
    Reading installed packages…
    ‘pkg’ not found.
    Resolving package dependencies…
    Generating solver test case…
    Solver test case generated successfully at /var/log/zypper.solverTestCase.

    pkg not found? Or another problem?

  2. March 24th, 2010 at 21:04 | #2 | Google Chrome 5.0.360.0openSUSE

    @kris
    You have to use the actual package name instead of “pkg” (that’s why it is in italics, but it is not so much visible …), for example:

    zypper install –-debug-solver tomboy

  3. March 24th, 2010 at 21:27 | #3 | Firefox 3.5.8openSUSE

    Thx.But please look here: http://img684.imageshack.us/img684/818/obrazz.png

    Last lines in console:

    2010-03-24 20:20:41 sphinx(7648) [zypp] SATResolver.cc(resolvePool):733 SATResolver::resolvePool() done. Ret:1
    QApplication: Invalid Display* argument
    2010-03-24 20:20:42 sphinx(7648) [zypp] Resolver_problems.cc(problems):54 Resolver::problems()

  4. March 24th, 2010 at 23:56 | #4 | Google Chrome 5.0.347.0openSUSE

    Cool stuff, it’d be curious to come up with the package that creates the most complex graph :)

    And yay, FlightGear 2.0.0! Awesome. Is it available for openSUSE 11.2 already? I had given up on trying to get it to build…

  5. March 25th, 2010 at 00:06 | #5 | Google Chrome 5.0.360.0openSUSE

    @kris
    You must not run the command from 6. as root (hint: QApplication: Invalid Display* argument). I updated the blogpost to reflect this, thanks!

    @LenZ
    FlightGear is available from “games” repository. I updated it a few weeks ago, but haven’t tested it.

  6. March 25th, 2010 at 00:26 | #6 | Google Chrome 5.0.347.0openSUSE

    Excellent, I’ll give it a try right away!

  7. March 25th, 2010 at 03:01 | #7 | Firefox 3.5.8openSUSE

    After install tomboy:

    kris@sphinx:~> /usr/lib/zypp/testsuite/bin/deptestomatic.multi solver-test.xml
    2010-03-25 01:58:34 sphinx(8209) [zypp] PathInfo.cc(readdir):574 readdir /etc/zypp/services.d
    2010-03-25 01:58:34 sphinx(8209) [zypp] RepoManager.cc(init_knownRepositories):546 start construct known repos
    2010-03-25 01:58:34 sphinx(8209) [zypp] RepoManager.cc(init_knownRepositories):567 end construct known repos
    2010-03-25 01:58:34 sphinx(8209) [testsuite++] deptestomatic.cc(main):1471 init_libzypp() done
    I/O warning : failed to load external entity “./solver-test.xml”
    Can’t parse test file ‘./solver-test.xml’
    2010-03-25 01:58:34 sphinx(8209) [zypp] PathInfo.cc(recursive_rmdir):429 recursive_rmdir /var/tmp/zypp.5HE9aI
    2010-03-25 01:58:34 sphinx(8209) [zypp++] TmpPath.cc(~Impl):78 TmpPath cleaned up /var/tmp/zypp.5HE9aI{d 0700 1000/100}

  8. March 25th, 2010 at 08:05 | #8 | Google Chrome 5.0.360.0openSUSE

    @kris
    You have to be INSIDE the /var/log/zypper.solverTestCase directory also when using normal user. You are currently running the command from your home directory.

  9. March 25th, 2010 at 11:48 | #9 | Firefox 3.5.8openSUSE

    Klaus Kaempf was presenting a paper on visualizing pack dependencies on openSUSE conference. Have you seen his talk?

    He was showing some tools he coded (mostly in Ruby) and these could draw 2D and 3D graphs, even create an animation illustrating how packages are gradually pulled in in the course of installation.

    Unfortunately, I have no clue where the code is now and whether kkaempf made it public. Could be worth pinging him :)

  10. March 25th, 2010 at 13:24 | #10 | Google Chrome 5.0.360.0openSUSE

    @bubli
    Yep, I saw it. The slides are here

  11. March 29th, 2010 at 00:16 | #11 | Opera 10.10GNU/Linux

    yast’s package manager can build such graphs in opensuse 11.2.
    right click on packet and third option from down. don’t know how that translated in english.
    example:
    http://s002.radikal.ru/i197/1003/a7/6435a93a6908.png

  1. April 11th, 2010 at 13:45 | #1 | vBSEO (VBulletin)
or