| apk-query(8) | System Manager's Manual | apk-query(8) |
NAME
apk query - query information about packages by various criteria
SYNOPSIS
apk query [<options>...] query...
apk query [<options>...] --recursive constraints...
DESCRIPTION
apk query searches for matching packages from selected sources.
In the default mode, query specifiers are interpreted as follows:
In the --recursive mode, the constraints specify a list of dependencies to satisfy and the solver algorithm is used to determine a list of packages that fullfill these constraints.
The query executes in the following steps:
- 1.
- Each query string is executed independently to select candidate packages
- 2.
- If --all-matches is not specified, the best candidate for given term is added to the list of result packages
- 3.
- The resulting package list is sorted
QUERY OPTIONS
The applets supporting query specifiers recognize the following options:
--all-matches
--available
--fields FIELDS[:REVERSE_FIELD]
--format FORMATSPEC
--from FROMSPEC
--installed
--match FIELDS
--recursive
--summarize FIELD[:REVERSE_FIELD]
--upgradable
--world
--orphaned
FIELDS
The field names are all small letters for --match and --fields options and for the machine parseable output (json and yaml). For the human readable default format the fields are capitalized.
The following package metadata fields are available: name, version, description, arch, license, origin, maintainer, url, commit, build-time, installed-size, file-size, provider-priority, depends, provides, replaces, install-if, layer, tags, triggers, scripts, and replaces-priority. See apk-package(8) package info metadata and package metadata sections for the description of these fields.
Additionally the following fields are available:
contents
download-url
owner
package
repositories
status
- installed
- broken-files
- broken-scripts
- broken-xattr
EXAMPLES
# search all packages starting with apk
apk query "apk*"
# show owner package of sensors executable in json
apk query --format json --match owner /usr/bin/sensors
# show apk-tools and its dependencies in yaml
apk query --format yaml --recursive apk-tools
# print source packages for all packages providing cmd:apk
apk query --match name,provides cmd:apk --fields origin
# print source packages with specific dependency name
apk query --match dependency so:libapk.so.2.14.9 --fields origin
| 2025-12-03 |