OpenBSD manual page server

Manual Page Search Parameters

PKG_INFO(1) General Commands Manual PKG_INFO(1)

pkg_infodisplay information on software packages

pkg_info [-AaCcdfIKLMmPqRSstUvz] [-D name[=value]] [-E filename] [-e pkg-name] [-l str] [-Q substring] [-r pkgspec] [pkg-name ...]

The pkg_info command is used to dump out information for packages, as created by pkg_create(1), which may be still packed up or already installed on the system with the pkg_add(1) command.

The pkg-name may be the name of an installed package, the pathname to a package distribution file, or a URL to a package available through FTP, HTTP, HTTPS, or SCP. pkg_info will try to complete pkg-name with a version number while looking through installed packages. If no pkg-name is specified, pkg_info shows the names and one-line comments for all installed packages except internal packages.

When browsing through uninstalled packages, running pkg_info -I *.tgz will report a summary line for each package, so that it is possible to run pkg_info pkgname.tgz to obtain a longer package description, and pkg_add -n pkgname.tgz to check that the installation would proceed cleanly, including dependencies.

The following command-line options are supported:

Show the names and one-line comments for all installed packages, including internal packages. This option cannot be combined with pkg-name arguments.
Show the names and one-line comments for all installed packages except internal packages. This option cannot be combined with pkg-name arguments. It is the default when neither options nor arguments are given.
Show certificate information for signed packages.
Show the one-line comment field for each package.
name[=value]
Enforce extra options as given by name, similarly to pkg_add(1).

List of trusted signers, separated by commas. Corresponds to list of public keys under /etc/signify we want to trust. Defaults to any key matching ‘*pkg’ for packages, and any key matching ‘*fw’ for firmware.
Force ‘%c’ and ‘%m’ to expand to ‘snapshots’, even on a release kernel.
Allow opening unsigned packages without warnings/errors (necessary for ports(7), automatically set by the build infrastructure).
Show the long-description field for each package.
filename
Look for the package(s) that contains the given filename. As a faster alternative, note that there is a package, pkglocatedb, that contains a locate(1) database of every file in every package.
pkg-name
This option allows you to test for the presence of another (perhaps prerequisite) package from a script. If the package identified by pkg-name is currently installed, return 0, otherwise return 1. In addition, the names of any package(s) found installed are printed to stdout unless turned off using the -q option.

The given pkg-name is actually a package specification, as described in packages-specs(7). For example, pkg_info -e 'name->=1.3' will match versions 1.3 and later of the name package.

pkgpath
Another variant of this option that uses a pkgpath instead. A pkgpath is a location within the ports tree, as described in pkgpath(7). For example, pkg_info -e x11/kde/base3 will match any package that was compiled according to ${PORTSDIR}/x11/kde/base3.
Show the packing-list instructions for each package. See pkg_create(1) and package(5) for the various annotations.
Show the name and one-line comment (“index entry”) for each package. This is done by default if neither options nor arguments are given.
Prefix file names with category keyword (e.g., @file, @lib). Always used together with -L.
Show the files within each package. This is different from just viewing the packing-list, since full pathnames for everything are generated.
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 necessarily 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.
Show the install-message file (if any) for each package.
Show the names and one-line comments for all packages tagged as manually installed, omitting those automatically installed as dependencies. This option cannot be combined with pkg-name arguments.
Show the pkgpath(7) for each package. You can easily build a subdirlist with this.
substring
Show the names of all packages in the first repository of the package search path containing the substring in the stems of their package names. A stem is a package name with all version and flavor suffixes removed; see pkg_add(1) for more details on stems. If -a is also specified, show the names of all matching packages in all repositories instead.
Be “quiet” in emitting report headers and such, just dump the raw info (basically, assume a non-human reading).
Show which packages require a given package.
pkgspec
Check a list for a given pkgspec. The following arguments are names of packages to verify. Exit status will be augmented by 2 if none of the packages do match.
Show the update signature for each package. The ‘update signature’ is a unique tag showing the package name, a global version number, and the version number of every run time dependency and shared library used to build this package.
Show an estimate of the total size of each package.
Show the names and one-line comments for packages which are not required by any other packages. This option cannot be combined with pkg-name arguments.
Show the deinstall-message file (if any) for each package.
Turn on verbose output.
Fuzzy listing option, often used together with -m. Only shows stems, flavors and branches information. To be reused with pkg_add(1) -l to recreate a package installation with different versions and no ambiguity. Note that this intentionally does not include firmware, as they are not handled by pkg_add(1).

The standard package database directory, /var/db/pkg, can be overridden by specifying an alternative directory in the PKG_DBDIR environment variable.
This can be used to specify a colon-separated list of paths to search for package files. The current directory is always searched first, even if PKG_PATH is set. If PKG_PATH is used, the suffix “.tgz” is automatically appended to the pkg-name, whereas searching in the current directory uses pkg-name literally. Each entry consists of a directory name. URL schemes such as FTP, HTTP, HTTPS, or SCP are also appropriate. The current directory may be indicated implicitly by an empty directory name, or explicitly by a single period (‘./’). Special sequences ‘%a’, ‘%c’, ‘%m’, ‘%v’ will be expanded.
Temporary area where package information files will be extracted, instead of /tmp.
Same semantics as PKG_PATH, but it is searched before PKG_PATH and waives any kind of signature checking.

/usr/local/share/doc/pkg-readmes/
OpenBSD-specific information about individual packages
/var/db/pkg/
database of installed packages(7)

Package info is either extracted from package files named on the command line, or from already installed package information in /var/db/pkg/<pkg-name>.

pkg_add(1), pkg_create(1), pkg_delete(1), bsd.port.mk(5), package(5), packages-specs(7), pkgpath(7)

Jordan Hubbard
initial design

Marc Espie
complete rewrite
May 29, 2022 OpenBSD-7.4