JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Adding and Updating Oracle Solaris 11 Software Packages     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information

Preface

1.  Introduction to the Image Packaging System

2.  IPS Graphical User Interfaces

3.  Getting Information About Software Packages

Showing Package Install State Information

Displaying Package Descriptions or Licenses

Showing Information From the Package Manifest

Listing Files Installed By a Package

Listing All Installable Packages In a Group Package

Displaying License Requirements

Searching for Packages

Identifying Which Package Delivers a Specific File

Listing Packages By Category

Showing Dependent Packages

Listing All Packages In a Group Package

4.  Installing and Updating Software Packages

5.  Configuring Installed Images

Searching for Packages

Use the pkg search command to search for packages whose data matches the specified pattern.

/usr/bin/pkg search [-HIaflpr] [-o attribute ...] [-s repo_uri] query

Like the pkg contents command, the pkg search command examines the contents of packages. While the pkg contents command returns the contents, the pkg search command returns the names of packages that match the query.

By default, pkg search query terms are matched exactly except for case. Use the -I option to specify a case-sensitive search. You can use ? and * wildcards in query terms.

You can specify more than one query term. By default, multiple terms are joined with AND. You can explicitly join two terms with OR.

Queries can be expressed in the following structured form:

pkg_name:action_type:key:token

Missing fields are implicitly wildcarded. Explicit wildcards are supported in the pkg_name and token fields. The action_type and key must match exactly. See the pkg(5) man page for a list of package actions and keys.

By default, repositories associated with all publishers configured for this image are searched. Use the -l option to search only packages that are installed in this image. Use the -s option to specify the URI of the repository to search.

By default, matches are displayed only for currently installed or newer package versions. Use the -f option to display all matched versions.

Identifying Which Package Delivers a Specific File

The following example shows that the libpower library came from the system/kernel/power package.

$ pkg search -l -H -o pkg.name /lib/libpower.so.1
system/kernel/power

Listing Packages By Category

The following example identifies all packages that have “Source Code Management” in the value of their info.classification attribute.

# pkg search ':set:info.classification:Source Code Management'
INDEX               ACTION VALUE                              PACKAGE
info.classification set    Development/Source Code Management pkg:/developer/versioning/subversion@1.6.16
info.classification set    Development/Source Code Management pkg:/developer/versioning/git@1.7.3.2-0.174
info.classification set    Development/Source Code Management pkg:/developer/versioning/sccs@0.5.11-0.174
info.classification set    Development/Source Code Management pkg:/library/perl-5/subversion@1.6.16-0.174
info.classification set    Development/Source Code Management pkg:/library/java/subversion@1.6.16-0.174.0
info.classification set    Development/Source Code Management pkg:/library/python-2/subversion@1.6.16-0.1
info.classification set    Development/Source Code Management pkg:/developer/xopen/xcu4@0.5.11-0.174.0.0.
info.classification set    Development/Source Code Management pkg:/developer/quilt@0.47-0.174.0.0.0.0.504
info.classification set    Development/Source Code Management pkg:/developer/versioning/cvs@1.12.13-0.174
info.classification set    Development/Source Code Management pkg:/developer/versioning/mercurial@1.8.4-0

This example shows a large amount of repeated information that obscures the information that was really wanted.

The following example uses the -o option to show only the names of the packages and uses the -H option to omit the column heading.

# pkg search -o pkg.name -H ':set:info.classification:Source Code Management'
developer/versioning/subversion
developer/versioning/git
developer/versioning/sccs
library/perl-5/subversion
library/java/subversion
library/python-2/subversion
developer/xopen/xcu4
developer/quilt
developer/versioning/cvs
developer/versioning/mercurial

Showing Dependent Packages

These examples show the packages that depend on the specified package.

The following example shows packages that have a require dependency on the system/kernel/power package. If you used the pkg contents command to display depend actions of type require for the i86pc and system/hal packages, you would see that system/kernel/power is listed for both packages.

$ pkg search -l -H -o pkg.name 'depend:require:system/kernel/power'
system/kernel/dynamic-reconfiguration/i86pc
system/hal

The following example shows that many packages have an exclude dependency on pkg:/x11/server/xorg@1.10.99.

$ pkg search -l -o pkg.name,fmri 'depend:exclude:'
PKG.NAME                                 FMRI
x11/server/xorg/driver/xorg-video-ati    pkg:/x11/server/xorg@1.10.99
x11/server/xorg/driver/xorg-video-intel  pkg:/x11/server/xorg@1.10.99
x11/server/xvnc                          pkg:/x11/server/xorg@1.10.99
desktop/remote-desktop/tigervnc          pkg:/x11/server/xorg@1.10.99
x11/server/xserver-common                pkg:/x11/server/xorg@1.10.99
...

Listing All Packages In a Group Package

The Oracle Solaris 11 GUI installer installs the solaris-desktop group package. The text installer and the default AI manifest in an Automated Installer installation install the solaris-large-server group package. The solaris-small-server group package is an alternative you can use to install a smaller set of packages on a server. You can use the following search form to display the set of packages that is included in each group.

$ pkg search -o fmri -H '*/solaris-desktop:depend:group:'
archiver/gnu-tar
audio/audio-utilities
...

In this example, -o pkg.name would return only the name of the package specified in the pkg_name field of the query:

group/system/solaris-desktop

The -o fmri option returns the FMRI of the packages that are specified in the solaris-desktop package as group type dependencies.

By default, search returns only packages that are installable in this image. In this example, search is not returning matching packages but rather is returning the value of an attribute of an action in a specified package. That attribute value happens to be a package name in this example. The number of results from this command is larger than the number of the results from the similar pkg contents command because these search results include the names of all packages that are named in group depend actions in the specified package, not just installable packages. For example, package variants might be included that are not installable in this image. Compare the output from this search to the output from the pkg contents command shown in Listing All Installable Packages In a Group Package.


Tip - In general, use the pkg contents command to show the contents of a specified package, and use the pkg search command to show packages that match a query. If you know which package delivers the content that you are interested in, use the pkg contents command.