LinuxCommandLibrary

pactree

visualizes package dependencies in a tree format

TLDR

Print dependency tree of a package

$ pactree [package]
copy
Print reverse dependencies (what depends on package)
$ pactree -r [package]
copy
List dependencies one per line, skip duplicates
$ pactree -u [package]
copy
Include optional dependencies with color
$ pactree -co [package]
copy
Limit tree depth
$ pactree -d [depth] [package]
copy
Display help
$ pactree
copy

SYNOPSIS

pactree [-c|--color] [-d depth] [-o|--optional] [-r|--reverse] [-u|--unique] package

DESCRIPTION

pactree visualizes package dependencies in a tree format. It queries pacman's database to show what packages a given package depends on, or with the reverse option, what packages depend on it.
The tool is useful for understanding package relationships, identifying orphaned packages, and planning package removal to avoid breaking dependencies.

PARAMETERS

-c, --color

Colorize output for better readability
-d, --depth _num_
Limit recursion depth
-o, --optional
Include optional dependencies in tree
-r, --reverse
Show reverse dependencies (packages depending on target)
-s, --sync
Query sync databases instead of local
-u, --unique
List each dependency only once, one per line
--config _file_
Use alternate pacman configuration

CAVEATS

Only shows dependencies for installed packages by default. Use -s flag for sync database queries. Large dependency trees can produce extensive output. Optional dependencies are hidden unless -o is specified.

HISTORY

pactree was originally a standalone script that became part of the official pacman-contrib package. It provides visual dependency information that pacman's standard query options don't offer in an easy-to-read format.

SEE ALSO

pacman(8), pactrans(1), pkgfile(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community