PKG-SEARCH(8)
π
pkg-search(8) β the System Manager's Manual page, but make it group chat π
β¨ NAME β¨
pkg search β search package repository catalogues π
π SYNOPSIS π
okay so here's the whole shape of it, bestie, no cap:
pkg search [-U] [-r reponame ...] [-S search] [-L label]
[-Q query-modifier] [-Cegix] pattern
pkg search [-cDdfopqRsU] [-r reponame ...] [-Cegix] pattern
pkg search [--no-repo-update] [--repository reponame ...]
[--search search] [--label label] [--query-modifier query-modifier]
[--{case-sensitive,exact,glob,case-insensitive,regex}] pattern
pkg search [--{comment,description,depends-on,full,origins,prefix}]
[--{quiet,raw,size,no-repo-update}] [--repository reponame ...]
[--{case-sensitive,exact,glob,case-insensitive,regex}]
[--raw-format format] pattern
π DESCRIPTION π
pkg search is the whole vibe for searching package repository catalogues. You can match packages that are available for installation by their name, by name and version, by origin, or by text inside the package comments or package descriptions. The output defaults to showing the field that got matched by the search term, but literally any of the searchable fields can be displayed. You can also modify the output so it shows a bunch of other package data available from the repository catalogues. Iconic.
Package repository catalogues get automatically updated whenever pkg search is run by a user ID with write access to the package database β unless you disable it with the -U flag or set REPO_AUTOUPDATE to NO in pkg.conf(5). Not me explaining this twice, it's just important.
Package repositories are defined in the pkg.conf file or by creating repository definitions in /usr/local/etc/pkg/repos. See pkg.conf(5) for details.
π OPTIONS π
The following options are supported by pkg search, and yes we're going through every single one:
-C,--case-sensitiveβ makes the exact (-e) or the regular expression (-x) matching againstpkg-namecase sensitive. Capital letters matter now, bestie π₯-c,--commentβ searches for packages with comment text matchingpattern. Equivalent to-S comment.-D,--descriptionβ searches for packages with description text matchingpattern. Equivalent to-S description.-d,--depends-onβ displays the list of packages depended on by each matched package. Equivalent to-Q depends-on.-e,--exactβ sayspatternshould be an exact match against the search field. No fuzzy business.-f,--fullβ shows βfullβ information about the package. Equivalent to-Q full. It's giving everything-at-once energy β¨-g,--globβ treatspatternas a shell globbing expression. The glob pattern must match the entire field being searched. Whole field or it doesn't count π-i,--case-insensitiveβ makes the exact (-e) or regular expression (-x) matching againstpatterncase insensitive. This is the default, unless modified by settingCASE_SENSITIVE_MATCHtotrueinpkg.conf.-Llabel,--labellabel β selects which identifying label is printed for each matched package, unless-qis used. Several different fields from the repository catalogue database may be used to search on, or to generate the label, as indicated by thelabelargument. See the βSearch and Label Optionsβ section for details. If unspecified,labelis set to the same as the value searched via the-S searchoption.-o,--originsβ lists packages by origin for each package matchingpattern. Equivalent to-L origin.-p,--prefixβ displays the package installation prefix for each matched package. Equivalent to-Q prefix.-q,--quietβ be βquietβ. Produces less output. In particular, it does not show an identifying label field for each package. Shhh π€«-Qquery-modifier,--query-modifierquery-modifier β modifies the query output by adding an additional field to the result. Multiple fields can be added by using additional-Q query-modifierflags. See the βOutput Modifier Optionsβ section for details.-rreponame,--repositoryreponame β searches for packages from only the named repository. This option can be specified multiple times to use several repositories. Packages will be searched from the named repositories only, irrespective of the configured βenabledβ status fromrepo.conf. By default, catalogues for all enabled repositories are searched.-R,--rawβ displays the full manifest (raw) from the matching packages. Raw and unfiltered, like my group chat receipts π-Ssearch,--searchsearch β specifies the field to search the repository catalogue on. If unspecified, it searches onpkg-nameunless the search term contains a/character, when it searches on port origin. Output will be sorted in order of the search field. See the βSearch and Label Optionsβ sections for more details.--raw-formatformat β chooses the format of the raw output. Theformatcan be:json,json-compact,ucl,yaml(default). Pick your fighter π-s,--sizeβ displays the installed size of matched packages. Equivalent to-Q size.-U,--no-repo-updateβ suppresses the automatic update of the local copy of the repository catalogue from remote. Automatic repository catalogue updates are only attempted when the effective UID of the process has write access to the package database. Otherwise they are silently ignored.-x,--regexβ treatspatternas a regular expression according to the βmodernβ or βextendedβ syntax ofre_format(7). This is the default. Matches any substring of the search field unless explicit beginning or ending anchor terms are used.
π§ Search and Label Options π§
Okay so these database fields (or composites of several fields) can be used both for searching for a match to the given pattern and as identifying labels for the block of output for each package:
commentβ the one line comment field describing the port, derived from theCOMMENTvariable in the port'sMakefile. When chosen as a label option, the output format will additionally include the package name, equivalent to-L pkg-name -Q comment. When chosen as a search option, only the comment field is used for sorting the output.comment-descriptionβ both the one line comment and the multi-line description fields. When chosen as a search option, a package will match ifpatternis found in either field. The output format will include the package name, comment and description. Results are sorted by comment. This option is only available as a search field (-S), not as a label option (-L).descriptionβ the multi-line package description from thepkg-descrfile in the port. This does include theWWWURL reference, if any, from that file. When chosen as a label option, the output format will additionally include the package name, equivalent to-L pkg-name -Q description. When chosen as a search option, only the description field is used for sorting the output.nameβ the name of the package, derived from thePORTNAMEvariable in the port'sMakefile.originβ the port origin, in the formatcategory/port, that the package was compiled from.pkg-nameβ the package name in the formatname-version. The same as thePKGNAMEvariable in the port'sMakefile.
Any unambiguous prefix of the label name may be used on the command line. Thus -Sd, -S descr and -S description are all equivalent. Love that for us π«Ά
π Output Modifier Options π
These add extra data from the repository catalogue to print for each matched package. Multiple output modifiers can be combined. Where more than one output field is required β either because multiple -Q query-modifier options were given, or one or more -Q query-modifier option was combined with the -L comment or -L description options β then each output field will be tagged with the field name. Periodt.
annotationsβ arbitrary text in tag-value format that can be added to any package. Cute little sticky notes for packages πarchβ the architecture string indicating what OS version and CPU architecture the package is suitable for. For example,freebsd:9:x86:64indicates a package suitable for FreeBSD 9.x running on an amd64 processor, whilefreebsd:*indicates an architecture independent package suitable for any version of FreeBSD.categoriesβ all categories, real and virtual, that the underlying package belongs to, derived from theCATEGORIESvariable in the port'sMakefile.commentβ the one line comment field describing the port, derived from theCOMMENTvariable in the port'sMakefile.depends-onβ the list of packages the named package depends on. Dependency packages are listed in the formatname-versionone per line. If the port has no dependencies, nothing will be output for this field, including suppressing the tag name when multiple output fields are requested.descriptionβ the multi-line package description from thepkg-descrfile in the port. This does include theWWWURL reference, if any, from that file.fullβ shows a standard set of fields, equivalent to a combination of thename,version,origin,prefix,repository,categories,license,maintainer,www,comment,options,shared-libs-required,shared-libs-provided,annotations,size,pkg-sizeanddescrfields, in that order. It's the whole fit check, bestie πlicensesβ displays a list of all the licenses the package is released under on a single line. Where more than one license applies, indicate if the terms of all licenses should apply (&) or if one or more licenses may be selected out of those available (|).maintainerβ displays the maintainer's e-mail address.nameβ displays the port name, which is derived from thePORTNAMEvariable in the port'sMakefile.optionsβ displays a list of the port options and their state (on or off) when the package was built. If the package does not have any options to set, nothing will be output for this field, including suppressing the tag name when multiple output fields are requested.pkg-sizeβ displays the size of the compressed package tarball, i.e., how much would need to be downloaded from the repository.prefixβ displays the installation prefix for the package, usually/usr/local.repositoryβ displays the repository name and the corresponding base URL for the repository. For a default repository defined inpkg.conf.required-byβ shows every package in the repo that needs the named package as a dependency π«Ά. These dependency packages come out inname-versionformat, one per line. And if literally nothing requires the named package? Then this field outputs nothing at all β and yes, it even suppresses the tag name when you asked for multiple output fields. Sneaky but true π .shared-libs-requiredβ if the package has dynamically linked FreeBSD ELF binaries in it, this lists every shared library those binaries need to run, except the ones from the base system. Small but important caveat: shared libraries for foreign binaries (like,Linuxones running under emulation) will not show up here, no cap. And if the package needs zero shared libraries, this field outputs nothing β tag name suppressed and everything, same deal as above when you're requesting multiple fields π.shared-libs-providedβ if the package ships any shared libraries, this lists the library names, including the ABI version number if there is one π. Lowkey a red flag moment here: a shared library β same ABI version or differing ones β may legitimately be provided by more than installed package, but it frequently indicates a problem. So like, don't panic, but do side-eye it π.sizeβ the total amount of filesystem space the package files will take up once they're unpacked and installed π¦.urlβ the URL that would be used to download the package from the repository β¬οΈ.versionβ the package version, which is derived from thePKGVERSIONvariable in the port'sMakefileβ¨.wwwβ the general URL, if any, for the project developing the software used in the package π. This gets extracted from thepkg-descrfile in the port.
Okay so shortcuts, because typing the whole thing is so much: any unambiguous prefix of the query modifier name may be used on the command line π«. So -Qm, -Q maint and -Q maintainer are all equivalent β iconic, she's flexible. But you do need at least -Q si and -Q sh to distinguish size from shared-libs-required or shared-libs-provided, and you'll need at least -Q shared-libs-p to select shared-libs-provided unambiguously. Ambiguity is not the vibe π« .
π ENVIRONMENT π
These environment variables affect how pkg search runs, bestie. Peep pkg.conf(5) for the full description of each π§.
PKG_DBDIRβ yep, that one ποΈ.CASE_SENSITIVE_MATCHβ and that one too π€.
π FILES π
See pkg.conf(5) π. That's the whole bit β go read it, iykyk.
π SEE ALSO π
A whole friend group of related pages, fr fr β go say hi to all of them π:
pkg_create(3)pkg_printf(3)pkg_repo_create(3)pkg_repos(3)pkg-keywords(5)pkg-lua-script(5)pkg-repository(5)pkg-script(5)pkg-triggers(5)pkg.conf(5)pkg(8)pkg-add(8)pkg-alias(8)pkg-annotate(8)pkg-audit(8)pkg-autoremove(8)pkg-check(8)pkg-clean(8)pkg-config(8)pkg-create(8)pkg-delete(8)pkg-fetch(8)pkg-help(8)pkg-info(8)pkg-install(8)pkg-key(8)pkg-lock(8)pkg-plugins(8)pkg-query(8)pkg-register(8)pkg-repo(8)pkg-repositories(8)pkg-rquery(8)pkg-set(8)pkg-shell(8)pkg-shlib(8)pkg-ssh(8)pkg-stats(8)pkg-triggers(8)pkg-unregister(8)pkg-update(8)pkg-updating(8)pkg-upgrade(8)pkg-version(8)pkg-which(8)
And that's a wrap, bestie!! π¦β¨ This lil masterpiece is from Debian, dated December 13, 2025, and it's the PKG-SEARCH(8) page π
. Go search something iconic. Periodt. π
π¦ where this page comes from
- nixos 26.05: pkg 2.7.5
- nixpkgs unstable: pkg 2.7.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms