How to visualize package dependencies in Ubuntu

Dependency graph of the package of the nano editor.
Dependency graph of the package of the nano editor.

In the Ubuntu package system, a package is dependent on many other packages and there can be other packages that are dependent on it. Thus, the Ubuntu package system is a huge complicated directed graph, with the packages as vertices and dependencies as directed edges.

It would be nice to sometimes to visually see the dependency graph of a package. That is, to see the graph of all packages that a given package is dependent on.

This can be done easily by using debtree. It can be easily installed from the Ubuntu repositories by using the package name debtree.

When invoked with the name of an installed package, it outputs its dependency graph to the standard output in the Dot format. This output can be redirected to a Dot file. I prefer to open this Dot file using Dot viewers like xdot to see the graph visually.

For example, to get the dependency graph of the package of the nano editor and view it:

$ debtree nano > nano.dot
$ xdot nano.dot

Thanks to the folks who answered my question on Ask Ubuntu.

Tried with: Ubuntu 12.04 LTS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s