PKGTREE(1) User Contributed Perl Documentation PKGTREE(1)

pkgtree - Display and query IPS package dependency tree

pkgtree [-a|--allow-repeats] [-C|--no-cache]
[-c|--clear-cache] [-D|--debug level]
[-d|--depth level] [-e|--names]
[-F|--force-cache] [-f|--cache-file file]
[-l|--latest] [-m|--max-depth level]
[-n|--ntype list] [-P|--no-pager]
[-r|--recurse] [-t|--type list]
[-U|--no-colour|--no-color]
[-x|--exact] [-y|--types]
{depends|dependants|no-dependants} [pkg_fmri]

pkgtree [-h|--help]

pkgtree [-v|--version]

pkgtree displays the IPS package dependency tree. It takes package information from the running system, caches it, then displays dependency information for all packages or for an individual package selected by pkg_fmri.

There are three main views that can be obtained from pkgtree. The first is a list of packages and what they depend on (the depends command). The second is a list of packages and what depends on them (the dependants command). The third is a list of packages on which no other package depends (the no-dependants command).

Each view may be affected by applying a variety of filters. See OPTIONS below.

The pkg_fmri may be a partial or full FMRI as described in pkg(5), and may optionally omit versioning information. Where present, the version number will filter on packages that depend on the given version or earlier. Use -x if an exact version match is desired.

pkgtree adds colour to aid readability if the output is going to a terminal. Colours are selected from a palette of five, and these may be changed by setting the environment variables PKGTREE_COL1 to PKGTREE_COL5 respectively. Colour codes accepted are those used by Term::ANSIColor. The -U option may be used if colour is not desired.

The following options are supported:

When recursing (-r), to reduce the output and compute time a package will only be expanded once. If the package is listed as a dependency again, it is not expanded by default, instead a double asterisk (**) is included at the end of the line. Alternatively this option disables the behaviour, which means that packages will be expanded each and every time they are encountered. If specifying -a you may also wish to couple it with -m to control compute time.
Don't use a cache file. Start-up time for pkgtree will be increased as it will launch pkg contents each and every invocation.
Normally pkgtree can detect if its cache file is possibly out of date due to changes in the /var/pkg/state/installed directory. However, you may also force removal of the cache file with this option, so that the cache file is refreshed. Start-up time for pkgtree will be longer with this option, as it re-launches pkg contents.
Turn on debugging and set to given level, which can be 1 to 3 for increased verbosity.
See -m.
Displays list of unique package FMRIs encountered during the query operation without reporting dependency types or visualising relationships by indentation.
If a cache file is being used but it is detected as stale due to changes in the /var/pkg/state/installed directory, then the cache will be cleared. Use this option to force use of the cache file, even if it is stale.
Specify an alternative path for the cache file. The default is /var/tmp/pkgtree.username.cache.
Display this help page.
Process latest packages from the package repositories and not those installed on the system. By default, pkgtree processes installed packages only. This option is only valid for the depends view when pkg_fmri is provided. It is not supported for dependants or no-dependants. When this option is specified, no cache file is used by default. To use a cache file, you must provide the -f option and specify a directory. Note that with the -l option you must provide a directory name for the cache, not a file name.
Set maximum level when recursing (-r), where level 1 allows one level of recursion, level 2 allows two levels and so on. Level 0 effectively disables recursion. This option may also be invoked as -d. By default there is no maximum depth.

If a package would have been expanded but was limited by this option, a double chevron (>>) will be displayed on the end of the line.

A comma-separated list of package dependency types that are not to be included in the output. These dependency types are filtered out. Valid dependency types are given in pkg(5).
By default, if STDOUT is not a terminal, the output of pkgtree is sent to less, or the pager named by the PAGER environment variable if given. This option disables the pager.
Show dependencies recursively. Packages listed with a require or require-any dependency will in turn have their dependencies expanded subject to the rules of maximum recursion depth (-m) and repeats (-a).

When used with no-dependants, for all packages that match the filter, test for ring fenced dependencies and report all additional FMRIs that are not required by any external package. This is helpful to determine, if a leaf package were to be removed, which other packages could also be removed as nothing else depends on them.

A comma-separated list of package dependency types that are to be included in the output. All other dependency types are filtered out. Valid dependency types are given in pkg(5).
Display version number.
Does not emit ANSI terminal escape sequences for output colourising. This may also be achieved by setting the environment variable ANSI_COLORS_DISABLED. By default colour sequences will be emitted unless output is not going to a terminal.
Turns on exact version matching. See DESCRIPTION.
Same as -e except additionally reports each dependency type.

/var/tmp/pkgtree.username.cache
Default cache file.

pkg(1), pkg(5), Term::ANSIColor.

2024-03-12 perl v5.38.2