man.bsd.lv manual page server

Manual Page Search Parameters

PKG-QUERY(8) System Manager's Manual PKG-QUERY(8)

pkg queryquery information for installed packages

pkg query ⟨query-format⟩ ⟨pkg-name⟩


pkg query [-a] ⟨query-format⟩

pkg query -F ⟨pkg-file⟩ ⟨query-format⟩

pkg query -e ⟨evaluation-condition⟩ ⟨query-format⟩

pkg query [-Cgix] ⟨query-format⟩ ⟨pattern⟩ ⟨...⟩


pkg query [--all] ⟨query-format⟩

pkg query --file ⟨pkg-file⟩ ⟨query-format⟩

pkg query --evaluate ⟨evaluation-condition⟩ ⟨query-format⟩

pkg query [--{case-sensitive,glob,case-insensitive,regex}] ⟨query-format⟩ ⟨pattern⟩ ⟨...⟩

pkg query is used for displaying information about packages.

The following options are supported by pkg query:

, --all
Match all packages from the database
, --case-sensitive
Make the standard or the regular expression (-x) matching against pkg-name case sensitive.
, --evaluate
Match packages using the given evaluation-condition. See EVALUATION FORMAT for details.
pkg-file, --file pkg-file
Display information only for the package file pkg-name
, --case-insensitive
Make the standard or regular expression (-x) matching against pkg-name case insensitive. This is the default, unless modified by setting CASE_SENSITIVE_MATCH to true in pkg.conf.
, --glob
Treat ⟨pattern⟩ as a glob pattern.
, --regex
Treat ⟨pattern⟩ as a regular expression according to the "modern" or "extended" syntax of re_format(7).

There are two types of keywords for the query format: the multiline and the normal one. Only one type of multiline pattern is accepted for a given query.

Name of the matched package
Version of the matched package
Origin of the matched package
Prefix of the matched package
Maintainer of the matched package
Comment of the matched package
Description of the matched package
Home page of the matched package
Returns 0 if the package is not marked as "vital", and 1 is the package is marked "vital".
License logic of the matched package - nothing for single, & for AND, and | for OR
[bh]
The flat size of the matched package, where b is in bytes, and h is in human readable format.
Returns 1 if the matched package was automatically installed as a dependency of another package, 0 otherwise. The package can be automatically removed via ‘pkg autoremove’ when this flag is set and no other package depends on it.
Alternative architecture of the matches package
Architecture of the matched package
Returns 1 if the matched package is locked against modification or deletion, 0 otherwise
message contained in the matched package
Timestamp that the package was installed
The name of the repository from which the package was installed if available, or “unknown-repository” otherwise.
[drCFODLUGBbA]
Returns 0 if the list is empty and 1 if the list has information to display
for dependencies
for reverse dependencies
for categories
for files
for options
for directories
for licenses
for users
for groups
for required shared libraries
for provided shared libraries
for annotations
[drCFODLUGBbA]
Returns the number of elements in the list
for dependencies
for reverse dependencies
for categories
for files
for options
for directories
for licenses
for users
for groups
for shared
for required shared libraries
for provided shared libraries
for annotations

[nov]
Expands to the list of dependencies for the matched package, where n stands for the package name, o for the package origin, and v for the package version.
[nov]
Expands to the list of reverse dependencies for the matched package, where n stands for the package name, o for the package origin, and v for the package version.
Expands to the list of categories the matched package belongs to.
[ps]
Expands to the list of files of the matched package, where p stands for path, and s for sum.
Expands to the list of directories of the matched package.
[kvdD]
Expands to the list of options of the matched package, where k stands for option key, v for option value, d for option default value and D for option description. Option default values and descriptions are optional metadata and may be blank for certain packages.
Expands to the list of license(s) for the matched package.
Expands to the list of users needed by the matched package.
Expands to the list of groups needed by the matched package.
Expands to the list of shared libraries used by programs from the matched package.
Expands to the list of shared libraries provided by the matched package.
[tv]
Expands to the list of annotations for the matched package, where t stands for the annotation tag, and v stands for the annotation value.

Packages can be selected by using expressions comparing Variables (see below) to string or integer values. The mode of comparison is specified by the Operator (also listed below). Expressions can be combined using && (for and) and || (for or). Parentheses can be used for grouping in the usual manner.

String values are either any text not containing whitespace (possibly followed by but not including whitespace) or any text enclosed in single or double quotes.

Name of the package (type string)
Origin of the package (type string)
Prefix of the package (type string)
Maintainer of the package (type string)
Comment of the package (type string)
Description of the package (type string)
WWW address of the package (type string)
Flatsize of the package (type integer)
Automatic status of the package (type integer)
Architecture of the package (type string)
Locking status of the package (type integer)
Message of the package (type string)
Timestamp that the package was installed (type integer)
Additional information about the package (type string)
[drCFODLUGBbA]
Number of elements in the list of information (type integer). See %? above for what information is used.

var ~ glob
The string value of var matches the given glob pattern.
var !~ glob
The string value of var does not match the given glob pattern.
var >[=] num
The numerical value of var is greater than [or equal to] the given number.
var <[=] num
The numerical value of var is less than [or equal to] the given number.
var =[=] num
The numerical value of var is equal to the given number.
var != num
The numerical value of var is not equal to the given number.

The following environment variables affect the execution of pkg query. See pkg.conf(5) for further description.

 
 

See pkg.conf(5).

The pkg query utility exits 0 on success, and >0 if an error occurs.

List all installed packages by name-version:

$ pkg query %n-%v

List all dependencies for a package by origin:

$ pkg query %do subversion

List all dependencies by package name-version:

$ pkg query %dn-%dv subversion

List all reverse dependencies for a package:

$ pkg query %ro perl

List all files and their known checksums for a package:

$ pkg query '%Fp %Fs' perl

List all files for all packages:

$ pkg query '%o: %Fp'

List all packages with no reverse dependencies:

$ pkg query -e '%#r = 0' %o

List non-automatic packages:

$ pkg query -e '%a = 0' %o

List automatic packages:

$ pkg query -e '%a = 1' %o

List unmaintained packages:

$ pkg query -e '%m = ports@FreeBSD.org' %o

pkg_printf(3), pkg_repos(3), pkg-repository(5), pkg.conf(5), pkg(8), pkg-add(8), pkg-annotate(8), pkg-audit(8), pkg-autoremove(8), pkg-backup(8), pkg-check(8), pkg-clean(8), pkg-config(8), pkg-convert(8), pkg-create(8), pkg-delete(8), pkg-fetch(8), pkg-info(8), pkg-install(8), pkg-lock(8), pkg-register(8), pkg-repo(8), pkg-rquery(8), pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8), pkg-ssh(8), pkg-stats(8), pkg-update(8), pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8)

November 18, 2016 DragonFly-5.6.1