| zypper – dependency graph |
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):
- install package
libzypp-testsuite-tools - run
zypper install --debug-solver pkg - cd into
/var/log/zypper.solverTestCase - open
solver-test.xmlin your favorite editor - add
<graphic/>tag just above the</trial>closing tag - run
/usr/lib/zypp/testsuite/bin/deptestomatic.multi solver-test.xml(as normal user, you won’t get any graph when running as root) - you can pan the graph, rotate it with the right click or even save it to disk!
The resulting image can be seen here:





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?
@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 tomboyThx.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()
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…
@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.
Excellent, I’ll give it a try right away!
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}
@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.
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
@bubli
Yep, I saw it. The slides are here
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