The pkg list command shows whether a package is installed in the current image and whether an update is available. With no options or operands, the pkg list 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. Quote the wildcards so that the argument is passed directly to pkg and the shell does not expand it.
The pkg list command displays one line of information for each matching package, as shown in the following example. The “i” in the I column indicates that these packages are installed in this image.
$ pkg list '*toolkit' NAME (PUBLISHER) VERSION IFO isvtoolkit (isvpub) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.175.2.0.0.34.0 i--
The publisher name in parentheses indicates that the isvpub 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.
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.175.2.0.0.17.0 --- isvtoolkit (isvpub) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.175.2.0.0.34.0 i--
This output indicates that the image/nvidia/cg-toolkit package is available and can be installed in this image.
To list the newest versions of all matching packages, including packages that cannot be installed in this image, use the -n option.
$ pkg list -n '*toolkit' 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.175.2.0.0.17.0 --- isvtoolkit (isvpub) 1.0 i-- system/dtrace/dtrace-toolkit 0.99-0.175.2.0.0.35.0 ---
The developer/dtrace/toolkit package and the system/dtrace/dtrace-toolkit package cannot be installed in this image. You know this because these packages were not listed by the -a option. The developer/dtrace/toolkit package has been renamed. See Renamed and Obsolete Packages for more information.
A newer version of the dtrace-toolkit package than the version that is currently installed in this image exists from configured publishers. The newer version might be installable if you also update other packages of which the dtrace-toolkit package is a dependency, as shown by the “Reason” line in the following example. Time stamps have been omitted from the following command output for brevity. The pkg update and pkg install commands are discussed in Installing and Updating Software Packages.
$ pkg update -nv dtrace-toolkit No updates are available for this image. $ pkg install -nv dtrace-toolkit@0.99-0.175.2.0.0.35 pkg install: No matching version of system/dtrace/dtrace-toolkit can be installed: Reject: pkg://solaris/system/dtrace/dtrace-toolkit@0.99,5.11-0.175.2.0.0.35.0 Reason: This version is excluded by installed incorporation pkg://solaris/consolidation/osnet/osnet-incorporation@0.5.11,5.11-0.175.2.0.0.34.0
The -u option lists all installed matching packages that have newer versions available. The number of packages that have newer versions available might be larger than the number of packages that could be updated in this image, as demonstrated in Newest Packages. Packages can be updated only to versions allowed by the constraints imposed on the image by installed package dependencies and publisher configuration.
$ pkg list -u '*toolkit' NAME (PUBLISHER) VERSION IFO system/dtrace/dtrace-toolkit 0.99-0.175.2.0.0.34.0 i--
To list all available versions of all matching packages, including packages that cannot be installed in this image, use the -af option. The -f option cannot be used without the -a option. You might want to specify a portion of the version string to narrow these results. Specifying the special version string @latest shows the same result as the -n option shows.
$ pkg list -af '*toolkit@0.99-0.175.2' $ pkg list -af '*toolkit@latest'
In the following example, the “r” in the O column indicates that the package has been renamed, and the “o” in the O column indicates that the package is obsolete.
$ pkg list -n developer/dtrace/toolkit database/mysql-50 web/amp NAME (PUBLISHER) VERSION IFO database/mysql-50 5.0.91-0.171 --o developer/dtrace/toolkit 0.99-0.173.0.0.0.1.0 --r web/amp 0.5.11-0.174.0.0.0.0.0 --r
None of these packages is installable. If you try to install an obsolete package, the installation fails with the message that no updates are necessary for this image. If you try to install a renamed package, the system attempts to install the package to which the renamed package has been renamed.
Use the pkg info command to determine the new name of a renamed package. Use the -r option to query the configured package repositories because the package is not installed. See the “Renamed to” line, as shown in the following example:
$ pkg info -r web/amp Name: web/amp Summary: State: Not installed (Renamed) Renamed to: group/feature/amp@0.5.11-0.174.0.0.0.0.0 consolidation/ips/ips-incorporation Publisher: solaris Version: 0.5.11 Build Release: 5.11 Branch: 0.174.0.0.0.0.0 Packaging Date: September 21, 2011 07:15:02 PM Size: 5.45 kB FMRI: pkg://solaris/web/amp@0.5.11,5.11-0.174.0.0.0.0.0:20110921T191502Z
If you try to install the web/amp package, the group/feature/amp package will be installed instead if it is not already installed and if it can be installed in this image.
In the following example, the “Renamed to” package is already installed, so the packaging system reports that no updates are necessary.
$ pkg info -r developer/dtrace/toolkit Name: developer/dtrace/toolkit Summary: State: Not installed (Renamed) Renamed to: pkg:/system/dtrace/dtrace-toolkit@0.99,5.11-0.173.0.0.0.0.0 consolidation/osnet/osnet-incorporation Publisher: solaris Version: 0.99 Build Release: 5.11 Branch: 0.173.0.0.0.1.0 Packaging Date: August 26, 2011 02:55:51 PM Size: 5.45 kB FMRI: pkg://solaris/developer/dtrace/toolkit@0.99,5.11-0.173.0.0.0.1.0:20110826T145551Z $ pkg list dtrace-toolkit NAME (PUBLISHER) VERSION IFO system/dtrace/dtrace-toolkit 0.99-0.175.2.0.0.34.0 i-- $ pkg install developer/dtrace/toolkit No updates necessary for this image.
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 openssl NAME (PUBLISHER) VERSION IFO library/security/openssl 1.0.1.6-0.175.2.0.0.34.0 if-