Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PKG-SEARCH(8)		     System Manager's Manual		   PKG-SEARCH(8)

NAME
     pkg search -- search package repository catalogues

SYNOPSIS
     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  searches the catalogue of packages available for installation.
     By default, pkg searches for case-sensitive package names from all  enabled
     repos.   Available  packages  can	also be matched by comment, description,
     origin, or version.  It returns the name, version, and comment by	default,
     but any data available from the catalogue may be displayed.

     Package  repository  catalogues  will be automatically updated whenever pkg
     search is run by a user ID with write access to the package  database,  un-
     less  disabled  by  the  -U  flag	or  setting  REPO_AUTOUPDATE  to  NO  in
     pkg.conf(5).

     Package repositories are defined in the pkg.conf file or by creating repos-
     itory definitions in /usr/local/etc/pkg/repos.   See  pkg.conf(5)	for  de-
     tails.

OPTIONS
     The following options are supported by pkg search:

     -C, --case-sensitive
		 Make  the  exact  (-e)  or the regular expression (-x) matching
		 against pkg-name case sensitive.  This is the	default,  unless
		 modified by setting CASE_SENSITIVE_MATCH to false in pkg.conf.

     -c, --comment
		 Search for packages with comment text matching pattern.  Equiv-
		 alent to -S comment.

     -D, --description
		 Search  for  packages	with  description text matching pattern.
		 Equivalent to -S description.

     -d, --depends-on
		 Display the list of packages depended on by each matched  pack-
		 age.  Equivalent to -Q depends-on.

     -e, --exact
		 pattern should be an exact match against the search field.

     -f, --full  Show  ``full'' information about the package.	Equivalent to -Q
		 full.

     -g, --glob  Treat pattern as a shell globbing expression.	The glob pattern
		 must match the entire field being searched.

     -i, --case-insensitive
		 Make the exact (-e) or regular expression (-x) matching against
		 pattern case insensitive.

     -L label, --label label
		 Select which identifying label  is  printed  for  each  matched
		 package,  unless -q is used.  Several different fields from the
		 repository catalogue database may be used to search on,  or  to
		 generate  the	label,	as indicated by the label argument.  See
		 the ""Search and Label Options"" section for details.	 If  un-
		 specified,  label  is set to the same as the value searched via
		 the -S search option.

     -o, --origins
		 List packages by origin  for  each  package  matching	pattern.
		 Equivalent to -L origin.

     -p, --prefix
		 Display  the package installation prefix for each matched pack-
		 age.  Equivalent to -Q prefix.

     -q, --quiet
		 Be "quiet".  Produce less output.  In particular do not show an
		 identifying label field for each package.

     -Q query-modifier, --query-modifier query-modifier
		 Modify the query output by adding an additional  field  to  the
		 result.   Multiple  fields  can be added by using additional -Q
		 query-modifier flags.	See the ""Output Modifier Options"" sec-
		 tion for details.

     -r reponame, --repository reponame
		 Search for packages from only the named repository.   This  op-
		 tion  can  be specified multiple times to use several reposito-
		 ries.	Packages will be searched from	the  named  repositories
		 only,	irrespective  of  the  configured  "enabled" status from
		 repo.conf.  By default, catalogues for all enabled repositories
		 are searched.

     -R, --raw	 Display the full manifest (raw) from the matching packages.

     -S search, --search search
		 Specify the field to search the repository  catalogue	on.   If
		 unspecified,  searches  on pkg-name unless the search term con-
		 tains 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-format format
		 Choose the format of the raw output.  The format can be:  json,
		 json-compact, ucl, yaml (default).

     -s, --size  Display  the installed size of matched packages.  Equivalent to
		 -Q size.

     -U, --no-repo-update
		 Suppress the automatic update of the local copy of the  reposi-
		 tory catalogue from remote.  Automatic repository catalogue up-
		 dates	are only attempted when the effective UID of the process
		 has write access to the package database.  Otherwise  they  are
		 silently ignored.

     -x, --regex
		 Treat pattern as a regular expression according to the "modern"
		 or  "extended"  syntax  of  re_format(7).  This is the default.
		 Matches any substring of the search field unless  explicit  be-
		 ginning or ending anchor terms are used.

   Search and Label Options
     The following database fields (or composites of several fields) can be used
     both  for searching for a match to the given pattern and as identifying la-
     bels for the block of output for each package.

     comment
	 The one line comment  field  describing  the  port,  derived  from  the
	 COMMENT  variable  in	the port's Makefile.  When chosen as a label op-
	 tion, 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 if pattern is 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 the pkg-descr file in the port.
	 This  does include the WWW URL 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 cho-
	 sen as a search option, only the description field is used for  sorting
	 the output.

     name
	 The  name  of	the  package,  derived from the PORTNAME variable in the
	 port's Makefile.

     origin
	 The port origin, in the format category/port, that the package was com-
	 piled from.

     pkg-name
	 The package name in the format name-version.  The same as  the  PKGNAME
	 variable in the port's Makefile.

     Any  unambiguous  prefix of the label name may be used on the command line.
     Thus -Sd, -S descr and -S description are all equivalent.

   Output Modifier Options
     Additional 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.

     annotations
	 Arbitrary text in tag-value format that can be added to any package.

     arch
	 The architecture string indicating what OS version and CPU architecture
	 the package is suitable for.  For example, freebsd:9:x86:64 indicates a
	 package  suitable  for FreeBSD 9.x running on an amd64 processor, while
	 freebsd:* 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 the CATEGORIES variable in the port's Makefile.

     comment
	 The one line comment  field  describing  the  port,  derived  from  the
	 COMMENT variable in the port's Makefile.

     depends-on
	 The list of packages the named package depends on.  Dependency packages
	 are listed in the format name-version one per line.  If the port has no
	 dependencies,	nothing  will  be  output for this field, including sup-
	 pressing the tag name when multiple output fields are requested.

     description
	 The multi-line package description from the pkg-descr file in the port.
	 This does include the WWW URL reference, if any, from that file.

     full
	 Show a standard set of fields, equivalent to a combination of the name,
	 version, origin, prefix, repository, categories,  license,  maintainer,
	 www,	comment,  options,  shared-libs-required,  shared-libs-provided,
	 annotations, size, pkg-size and descr fields, in that order.

     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
	 Display the maintainer's e-mail address.

     name
	 Display  the  port name, which is derived from the PORTNAME variable in
	 the port's Makefile.

     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
	 Display  the  size  of  the  compressed package tarball, i.e., how much
	 would need to be downloaded from the repository.

     prefix
	 Display 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 in pkg.conf.

     required-by
	 Displays  all	of the packages in the repository that require the named
	 package as a dependency.  Dependency packages are listed in the  format
	 name-version  one  per  line.	 If  no other packages require the named
	 package, nothing will be output for this field,  including  suppressing
	 the tag name when multiple output fields are requested.

     shared-libs-required
	 If  the  package contains dynamically linked FreeBSD ELF binaries, dis-
	 play a list of all of the shared libraries other than	those  from  the
	 base  system  required for those binaries to run.  Shared libraries for
	 foreign (e.g., Linux) binaries run under emulation  will  not	be  dis-
	 played.   If the package does not require any shared libraries, nothing
	 will be output for this field including suppressing the tag  name  when
	 multiple fields are requested.

     shared-libs-provided
	 If the package contains any shared libraries, display a list of the li-
	 brary	names,	including  the ABI version number, if any.  A shared li-
	 brary, of either the same or differing ABI versions,  may  legitimately
	 be  provided  by more than installed package, but this frequently indi-
	 cates a problem.

     size
	 Display the total amount of filesystem space  the  package  files  will
	 take up once unpacked and installed.

     url
	 Display  the  URL  that  would be used to download the package from the
	 repository.

     version
	 Display the package version, which is derived from the PKGVERSION vari-
	 able in the port's Makefile.

     www
	 Display the general URL, if any, for the project developing  the  soft-
	 ware used in the package.  This is extracted from the pkg-descr file in
	 the port.

     Any  unambiguous  prefix of the query modifier name may be used on the com-
     mand line.  Thus -Qm, -Q maint and -Q maintainer are  all	equivalent,  but
     you  need	to  use  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 the shared-libs-provided unambiguously.

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

     PKG_DBDIR

     CASE_SENSITIVE_MATCH

FILES
     See pkg.conf(5).

SEE ALSO
     pkg_checksum(3), pkg_create(3), pkg_printf(3), pkg_repo_create(3),  pkg_re-
     pos(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-check-
     sum(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-rwhich(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)

FreeBSD ports 15.quarterly	  May 26, 2026			   PKG-SEARCH(8)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pkg-search&sektion=8&manpath=FreeBSD+Ports+15.1.quarterly>

home | help