|Skip Navigation Links|
|Exit Print View|
|Adding and Updating Oracle Solaris 11 Software Packages Oracle Solaris 11 Information Library|
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. Package variants for an architecture or zone type that does not match this image are not listed.
/usr/bin/pkg list [-Hafnsuv] [-g path_or_uri ...] [--no-refresh] [pkg_fmri_pattern ...]
The pkg list command displays one line of information for each package.
$ pkg list *toolkit* NAME (PUBLISHER) VERSION IFO isvtoolkit (isv.com) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.174.0.0.0.0.17765 i--
The publisher name in parentheses indicates that the isv.com publisher is not the first publisher in the publisher search order in this image. The dtrace-toolkit package that is installed in this image is published by the publisher that is the first publisher in the search order.
The “i” in the I column indicates that these packages are installed in this image. 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.
$ pkg list -a *toolkit* NAME (PUBLISHER) VERSION IFO image/nvidia/cg-toolkit 3.0.15-0.174.0.0.0.0.0 --- isvtoolkit (isv.com) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.174.0.0.0.0.17765 i--
This output indicates that the image/nvidia/cg-toolkit can be installed in this image.
To list all matching packages, including packages that cannot be installed in this image, use the -af option. To list only the newest versions of these packages, specify @latest.
$ pkg list -af *toolkit@latest NAME (PUBLISHER) VERSION IFO developer/dtrace/toolkit 0.99-0.173.0.0.0.1.0 --r image/nvidia/cg-toolkit 3.0.15-0.174.0.0.0.0.0 --- isvtoolkit (isv.com) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.174.0.0.0.0.17765 i--
This output indicates that the developer/dtrace/toolkit package cannot be installed in this image. The “r” in the O column indicates that this package has been renamed. The developer/dtrace/toolkit package has been renamed to system/dtrace/dtrace-toolkit, and system/dtrace/dtrace-toolkit is already installed.
In the following example, the web/amp package has been renamed. The package displays without using the -f option because the web/amp package has been renamed to group/feature/amp, and group/feature/amp is not installed. If you specify the command to install the web/amp package, the group/feature/amp package is installed automatically.
$ 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
The pkg list command does not tell you the new name of a renamed package. To get that information, use the pkg info command as shown in Displaying Package Descriptions or Licenses.
The -n option lists the newest version of each known package. An “o” in the O column indicates that the package is obsolete. You cannot install a package that is obsolete.
$ pkg list -n *mysql-5? NAME (PUBLISHER) VERSION IFO database/mysql-50 5.0.91-0.171 --o database/mysql-51 5.1.37-0.174.0.0.0.0.504 ---
This output indicates that the database/mysql-50 package cannot be installed in this image. This package has not been renamed. If you specify the command to install the mysql-50 package, the mysql-51 package is not installed. No packages are installed in this case.
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. See Locking Packages to a Specified Version for information about freezing packages.
$ pkg list mercurial NAME (PUBLISHER) VERSION IFO developer/versioning/mercurial 1.8.4-0.174.0.0.0.0.504 if-
The -s option lists only the package name and summary.
$ pkg list -ns mysql-51 feature/amp NAME (PUBLISHER) SUMMARY database/mysql-51 MySQL 5.1 Database Management System group/feature/amp AMP (Apache, MySQL, PHP) Deployment Kit for Oracle Solaris
The -v option lists the full package FMRI.
$ pkg list -nv mysql-51 FMRI IFO pkg://email@example.com,5.11-0.174.0.0.0.0.504:20110920T230125Z ---
The -u option lists all installed packages that have newer versions available.
Use the -g option to specify the repository or package archive to use as the source of package data for the operation.
When you use the --no-refresh option, pkg does not attempt to contact the repositories for the image's publishers to retrieve the newest list of available packages.