pacgraph
Visualize Arch Linux package dependencies graphically
TLDR
Produce an SVG and PNG graph
Produce an SVG graph
Print summary to console
Override the default filename/location (Note: Do not specify the file extension)
Change the color of packages that are not dependencies
Change the color of package dependencies
Change the background color of a graph
Change the color of links between packages
SYNOPSIS
pacgraph [OPTIONS]
PARAMETERS
-c, --color
Color nodes in the graph based on package type (e.g., base, explicitly installed, required, unrequired) for better visual distinction.
-d file, --dotfile=file
Specify the output file path for the generated .dot graph description. This file can then be processed by Graphviz tools.
-o file, --output=file
Directly specify the output file path for the final rendered image (e.g., PNG, SVG). This option requires the dot command to be available in the system's PATH.
-s size, --size=size
Set the maximum size of the output graph image. Useful for controlling output dimensions, especially for very large graphs.
-t, --transitive
Include transitive dependencies in the graph, showing not just direct dependencies but also dependencies of dependencies, and so on.
-u, --upto
Generate a graph showing packages that depend on the specified target packages (reverse dependencies).
-w, --web
Generate an interactive HTML web page with the graph, allowing for zooming and panning within a web browser.
-?, --help
Display a help message and exit.
--version
Show program's version number and exit.
DESCRIPTION
pacgraph is a powerful Python-based utility designed for Arch Linux users to visually represent their installed package dependencies. It leverages the Graphviz suite to generate graphical layouts from package relationship data. Users can choose to display direct and transitive dependencies, or explore reverse dependencies (which packages depend on a given one). This tool is invaluable for understanding the complex web of inter-package relationships on a system, helping to identify orphaned packages, visualize the impact of removing software, or simply gain insight into the system's structure.
The output is typically a .dot file, a plain text graph description language, which can then be rendered into various image formats like PNG, SVG, or JPEG using the dot command from Graphviz. It can also generate interactive web pages for exploration.
CAVEATS
Generating a graph of an entire system can result in a very large and complex image, which may be slow to render or difficult to interpret visually. For large systems, it's often more effective to generate graphs for specific subsets of packages or use the interactive web output.
The quality and readability of the generated graphs heavily depend on the underlying Graphviz installation and its algorithms.
REQUIREMENTS
pacgraph requires the Graphviz package (specifically the dot command) to be installed on the system to render the generated .dot files into image formats or interactive web pages. Without Graphviz, pacgraph can only output the raw .dot graph description files.
BASIC USAGE EXAMPLE
To generate a PNG image of your system's package dependencies:pacgraph -d system_deps.dot && dot -Tpng system_deps.dot -o system_deps.png
To generate an interactive web page:pacgraph --web > index.html
HISTORY
pacgraph was developed as a complementary tool for Arch Linux's pacman package manager. Its creation aimed to provide a visual understanding of the package ecosystem, which is often challenging to grasp from text-based dependency listings alone. It leverages the robust and widely used Graphviz software, building upon its graph visualization capabilities to offer a more intuitive perspective on package relationships.