Posted: . At: 1:32 PM. This was 7 years ago. Post ID: 10450
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How the Linux command line can create a graphical tree of package dependencies.

Image unknown. Some decoded SSTV image.
Image unknown. Some decoded SSTV image.

The Linux command line may be used to create a graphical display of package dependencies. This is good for visualizing what other components of Ubuntu are required for a certain package to operate. And the images look very cool when put on a website as well. A great Linux feature. Creating a graphical display of dependencies would be good to put on a website if a programmer has created a program and needs to display all of the dependencies required to run it. Or just to show off the abilities of the Linux command line in scripting.

Firstly, install the graphviz package.

ubuntu ~ $ sudo apt-get install graphviz

Then run this command to get information about bash.

ubuntu ~ $ apt-cache -o APT::Cache::GivenOnly=1 dotty bash | dot -T png > out.png

The generated image will look like this.

Dependencies tree of bash.
Dependencies tree of bash.

This one is for the nmap package.

Tree of dependencies for nmap.
Tree of dependencies for nmap.

This is a very nice tip for those who are using Linux distributions that have the apt package manager and wish to visualize how packages are interrelated and have many dependencies.

Here is another very cool trick.

ubuntu ~ $ printf 'You are a bigot. \b\b\b\b\b\b\bwonderful person.\n' | pv -qL 10
You are a wonderful person.

This command will print “You are a bigot.”, then it will backspace and edit it to say “You are a wonderful person.”. Very funny Linux trick.

You need to sudo apt install pv to use this cool command.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.