The
pkg_info command is used to dump out information for packages, which may be either packed up in files or already installed on the system with the
pkg_create(1) command.
The
pkg-name may be the name of an installed package (with our without version), a pattern matching several installed packages (see the
PACKAGE WILDCARDS section for a description of possible patterns), the pathname to a binary package, a filename belonging to an installed package (if
-F is also given), or a URL to an ftp-available package.
The following command-line options are supported:
-a
Show information for all currently installed packages. See also -u.
-B
Show some of the important definitions used when building the binary package (the “Build information”) for each package. Additionally, any installation information variables (lowercase) can be queried, too. In particular, automatic tells if a package was installed automatically as a dependency of another package.
-b
Show the NetBSD RCS Id strings from the files used in the construction of the binary package (the "Build version") for each package. These files are the package Makefile, any patch files, any checksum files, and the packing list file.
-c
Show the one-line comment field for each package.
-D
Show the install-message file (if any) for each package.
-d
Show the long-description field for each package.
-E pkg-name
This option allows you to test for the existence of a given package. If a package identified by
pkg-name is currently installed, return code is 0, otherwise 1. The name of the best matching package found installed is printed to stdout unless turned off using the
-q option.
pkg-name can contain wildcards (see the
PACKAGE WILDCARDS section below).
-e pkg-name
This option allows you to test for the existence of a given package. If a package identified by
pkg-name is currently installed, return code is 0, otherwise 1. The names of any package(s) found installed are printed to stdout unless turned off using the
-q option.
pkg-name can contain wildcards (see the
PACKAGE WILDCARDS section below).
-F
Interpret any pkg-name given as filename, and translate it to a package name using the package database. This can be used to query information on a per-file basis, e.g. in conjunction with the -e flag to find out which package a file belongs to.
-f
Show the packing list instructions for each package.
-I
Show the index entry for each package.
-i
Show the install script (if any) for each package.
-K pkg_dbdir
Override the value of the PKG_DBDIR configuration option with the value pkg_dbdir.
-k
Show the de-install script (if any) for each package.
-L
Show the files within each package. This is different from just viewing the packing list, since full pathnames for everything are generated. Files that were created dynamically during installation of the package are not listed.
-l str
Prefix each information category header (see -q) shown with str. This is primarily of use to front-end programs that want to request a lot of different information fields at once for a package, but don't necessary want the output intermingled in such a way that they can't organize it. This lets you add a special token to the start of each field.
-m
Show the mtree file (if any) for each package.
-N
Show which packages each package was built with (exact dependencies), if any.
-n
Show which packages each package needs (depends upon), if any.
-p
Show the installation prefix for each package.
-Q
Show the definition of variable from the build information for each package. An empty string is returned if no such variable definition is found for the package(s).
-q
Be “quiet” in emitting report headers and such, just dump the raw info (basically, assume a non-human reading).
-R
For each package, show the packages that require it.
-r
For each package, show the packages that require it. Continue recursively to show all dependents.
-S
Show the size of this package and all the packages it requires, in bytes.
-s
Show the size of this package in bytes. The size is calculated by adding up the size of each file of the package.
-u
Show information for all user-installed packages. Automatically installed packages (as dependencies of other packages) are not displayed. See also -a.
-V
Print version number and exit.
-v
Turn on verbose output.
-X
Print summary information for each package. The summary format is described in
pkg_summary(5). Its primary use is to contain all information about the contents of a (remote) binary package repository needed by package managing software.