|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Administration: Common Tasks Oracle Solaris 11 Information Library|
Use the following commands to retrieve information about packages. No special privileges are needed to run any of these commands.
The pkg list command tells you whether a package is installed in the current image and whether an update is available. With no options or operands, this command lists all packages that are installed in the current image. To narrow your results, provide one or more package names. You can use wildcards in the package names.
The pkg info command displays information about a package, including the name, installed state, version, packaging date, package size, and the full FMRI. With no options or operands, this command displays information about all packages that are installed in the current image. To narrow your results, provide one or more package names. You can use wildcards in the package names.
The pkg contents command displays the file system content of packages. With no options or operands, this command displays path information for all packages that are installed in the current image. Use command options to specify particular package content to display. See the pkg(1) man page and Adding and Updating Oracle Solaris 11 Software Packages for information about options of the pkg contents command. To narrow your results, provide one or more package names. You can use wildcards in the package names.
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 and ANDed together. See the pkg(1) man page and Adding and Updating Oracle Solaris 11 Software Packages for additional options for structuring queries.
The remainder of this section shows some examples of using these commands to display information about packages.
$ pkg list amp pkg list: no packages matching 'amp' installed
To list packages that are installed and the newest versions of packages that are not installed but could be installed in this image, use the -a option. The “-” in the I column indicates that the package is not installed. The “r” in the O column indicates that the web/amp package has been renamed. If you give the command to install the web/amp package, the group/feature/amp package is installed.
$ pkg list -a amp NAME (PUBLISHER) VERSION IFO group/feature/amp 0.5.11-0.174.0.0.0.0.2559 --- web/amp 0.5.11-0.174.0.0.0.0.0 --r
An “o” in the O column indicates that package is obsolete. You cannot install a package that is marked obsolete. An “f” in the F column indicates the package is frozen. If a package is frozen, you can only install or update to packages that match the frozen version.
Use the pkg info command to display more information. Because you already know the package is not installed in this image, use the -r option to query the package repository.
$ pkg info -r amp Name: group/feature/amp Summary: AMP (Apache, MySQL, PHP) Deployment Kit for Oracle Solaris Description: Provides a set of components for deployment of an AMP (Apache, MySQL, PHP) stack on Oracle Solaris Category: Meta Packages/Group Packages (org.opensolaris.category.2008) Web Services/Application and Web Servers (org.opensolaris.category.2008) State: Not installed Publisher: solaris Version: 0.5.11 Build Release: 5.11 Branch: 0.174.0.0.0.0.2559 Packaging Date: Wed Sep 21 19:12:55 2011 Size: 5.45 kB FMRI: pkg://firstname.lastname@example.org,5.11-0.174.0.0.0.0.2559:20110921T191255Z Name: web/amp Summary: State: Not installed (Renamed) Renamed to: email@example.com consolidation/ips/ips-incorporation Publisher: solaris Version: 0.5.11 Build Release: 5.11 Branch: 0.174.0.0.0.0.0 Packaging Date: Wed Sep 21 19:15:02 2011 Size: 5.45 kB FMRI: pkg://firstname.lastname@example.org,5.11-0.174.0.0.0.0.0:20110921T191502Z
To display more information about what is in this package, use the pkg contents command.
$ pkg contents -r group/feature/amp pkg: This package delivers no file system content, but may contain metadata. Use the -o option to specify fields other than 'path', or use the -m option to show the raw package manifests.
The group/feature/amp package does not contain information about files because the group/feature/amp package is a group package. Instead of files, a group package installs other packages. Use the following options to see which packages are installed by the group/feature/amp group package. The -t depend option means only list contents that are depend actions. The -a option specifies that the type attribute of the depend action must have the value group. The -o fmri option means output only the package FMRI from each matched depend action of type group. The -H option omits headers.
$ pkg contents -rt depend -a type=group -o fmri -H group/feature/amp database/mysql-51 web/php-52 web/php-52/extension/php-apc web/php-52/extension/php-mysql web/server/apache-22 web/server/apache-22/module/apache-dtrace web/server/apache-22/module/apache-fcgid web/server/apache-22/module/apache-php5
If you know the name of the tool you want to install but do not know the name of the package, use the search subcommand. By default, pkg search returns the actions that match the query and the package that contains those actions. The following examples show two ways to use search to determine that you need to install the package editor/gnu-emacs to get the emacs tool.
$ pkg search /usr/bin/emacs INDEX ACTION VALUE PACKAGE path file usr/bin/emacs pkg:/email@example.com $ pkg search file::emacs INDEX ACTION VALUE PACKAGE basename file usr/bin/emacs pkg:/firstname.lastname@example.org basename file usr/share/info/emacs pkg:/email@example.com