Install Graphviz on Ubuntu 26.04

Install Graphviz on Ubuntu 26.04

Graphviz is an open-source graph visualization toolkit used to create diagrams from text-based descriptions. It includes several layout engines and command-line tools for generating flowcharts, dependency graphs, network diagrams, and other visual representations. This tutorial demonstrates how to install Graphviz on Ubuntu 26.04.

Install Graphviz

Refresh the package index to ensure the latest package information is available:

sudo apt update

Install the Graphviz:

sudo apt install -y graphviz

Confirm that the installation completed successfully by displaying the Graphviz version:

dot --version

Testing Graphviz

To test functionality, run the following command to create a basic graph and save it as a PNG image:

echo 'digraph { a -> b }' | dot -Tpng -o graph.png

After the command finishes, a file named graph.png will be created in the current directory containing a simple graph with a single connection from node a to node b.

Uninstall Graphviz

If Graphviz is no longer needed, remove the package along with any automatically installed dependencies that are no longer required:

sudo apt purge --autoremove -y graphviz

Leave a Comment

Cancel reply

Your email address will not be published.