Identifying and Specifying an Installable Package

If the image has more than one publisher enabled, you can control which publisher provides a package by setting publisher stickiness and search order or by specifying the publisher in the package FMRI. You can also specify the version you want to install in the package FMRI. See Fault Management Resource Identifiers for a description of a package FMRI. See Configuring Publishers for information about setting publisher stickiness and search order.

If the package name does not specify the publisher, the first publisher that provides a matching package is used as the installation source. If that publisher does not provide a version of the package that can be installed in this image, then the installation operation fails. Use the pkg list -a command to see which publishers provide a version of the package that can be installed in this image.

The following commands show that an installable version of the package atool is available from a configured publisher, but the publisher that is first in the search order has a version that is not installable in this image. See Showing Package Install State Information for information about options of the pkg list command.

$ pkg list -a atool
NAME (PUBLISHER)     VERSION    IFO
atool (isvpub)       2.0        ---
$ pkg list -af atool
NAME (PUBLISHER)     VERSION    IFO
atool                1.1        ---
atool (isvpub)       2.0        ---

In this case, the following install command fails. The packaging system finds a match of the package name atool from the publisher that is first in the search order, but that package cannot be installed.

$ pkg install atool

To install this package, make the package name more specific, as shown in the following examples:

$ pkg install //isvpub/atool
$ pkg install atool@2.0

Use the -nv option to see what will be installed before you perform the actual installation. If you receive an error message, see Troubleshooting Package Installation and Update for help.