Adding and Updating Software in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Common Installation Options

This section discusses options that are common to multiple installation-related commands. Note that setting or unsetting a mediator, changing a variant or facet, fixing a package, or reverting a file can also involve installing, updating, or uninstalling packages.

Boot Environment Options

A new BE or a backup BE might be created automatically when you install, update, or uninstall a package. Within the constraints of the image policy regarding BEs, you can control the creation of new and backup BEs using the options described below. See Boot Environment Policy Image Properties for information about new BEs and backup BEs and how to set image policy regarding BEs.

Use the following BE options to force a new BE or backup BE to be created or not created, to give the BE a custom name, and to specify that the new BE should not be activated. These options are available for the install, exact-install, uninstall, update, revert, set-mediator, unset-mediator, change-variant, and change-facet subcommands.

--no-be-activate

If a BE is created, do not set it as the active BE on the next boot.

In the command output, note any messages that say a new boot environment has been created. If a new boot environment has been created and activated, that BE is booted by default on the next reboot if you do not specify the --no-be-activate option.

Use the beadm (1M) command to show and change the active BE separate from any pkg command.

--no-backup-be

Do not create a backup BE.

--require-backup-be

Create a backup BE if a new BE will not be created. Without this option, a backup BE is created based on image policy. See Boot Environment Policy Image Properties for an explanation of when backup BEs are created automatically.

--backup-be-name name

If a backup BE is created, name it name instead of a default name. Use of --backup-be-name implies --require-backup-be.

--deny-new-be

Do not create a new BE. The install, update, uninstall, or revert operation is not performed if a new BE is required.

--require-new-be

Create a new BE. Without this option, a BE is created based on image policy. See Boot Environment Policy Image Properties for an explanation of when BEs are created automatically. This option cannot be combined with --require-backup-be.

--be-name name

If a BE is created, name it name instead of a default name. Use of --be-name implies --require-new-be. Using this option is the safest way to perform operations

Options That Operate on Non-Global Zones

As discussed in Working with Non-Global Zones, only some package installations, removals, and updates performed in the global zone automatically affect non-global zones. The -r option performs the same pkg operation in non-global zones that you entered in the global zone, possibly affecting many more packages than would be affected if you did not use -r. These options are available for the install, uninstall, update, change-variant, and change-facet subcommands.

-r

Run this operation in the global zone and also in all installed solaris branded non-global zones. The effect on the non-global zone is similar to logging into each non-global zone and running the command directly.

Without this option, when you run pkg commands in the global zone, non-global zones are modified only to the extent required to keep them compatible with the global zone as described in Working with Non-Global Zones. With this option, the pkg operation is applied to all installed non-global zones except as limited by the -z and -Z options. Zones that are excluded by the -z and -Z options might still be modified if updates are required to keep them in sync with the global zone.

-z zone

Run this operation only in the specified non-global zone. The -z option can be specified multiple times. The -z option can only be used with the -r option. The -z option cannot be used with the -Z option.

-Z zone

Run this operation in all non-global zones except for the specified zone. The -Z option can be specified multiple times. The -Z option can only be used with the -r option. The -Z option cannot be used with the -z option.

The following option specifies the number of non-global zones to update concurrently with the global zone. This option is available for the install, exact-install, uninstall, update, change-variant, and change-facet subcommands.

-C n

Update at most n installed solaris branded non-global zones in parallel with the global zone. If n is 0 or a negative number, all non-global zones are updated concurrently with the global zone.

The environment variable PKG_CONCURRENCY can also be set to the value n. The -C option overrides the PKG_CONCURRENCY setting. If the -C option is specified, PKG_CONCURRENCY is ignored.

Service Action Options

A package might specify SMF service actions such as restarting or refreshing a specified service when the package is installed or updated. If you are operating on a large number of packages, the pkg operation might finish before all the service actions finish. Then you might not be able to use the newly-installed software because an associated service is not yet available.

To avoid this problem, use one of the following options to run SMF actuators synchronously with the pkg command. These options are available for the install, uninstall, update, change-variant, and change-facet subcommands.

--sync-actuators

When you specify this option, the pkg command will not return until all SMF actuators have finished in the zone in which pkg was invoked (the global zone or a non-global zone).

--sync-actuators-timeout timeout

When you specify this option, the pkg command will not return until all SMF actuators have finished or the timeout period is reached, whichever is shorter. If the actuators do not finish within the given timeout in seconds, the pkg command continues operation and exits with return code 8.

License Options

You might be required to accept a license before you can install or update a package. Use the following options to view and accept required licenses. These options are available for the install, exact-install, update, fix, change-variant, and change-facet subcommands.

--licenses

Use the --licenses option to display all of the licenses for the packages that are installed or updated as part of this operation. Licenses for all packages are displayed, not just licenses that must be accepted to enable this operation to proceed. If a license must be accepted to proceed, that license is displayed even if you do not specify the --licenses option. To view the license for a package without starting any other operation, use the pkg list command as shown in Displaying Package Licenses. To display a list of licenses that must be accepted, use the pkg info command as shown in Displaying License Requirements.

--accept

Use the --accept option to indicate that you agree to and accept the terms of the licenses of the packages that are updated or installed. If you do not provide this option and any package licenses require acceptance, the required license is displayed and the installation operation fails.

Other Installation Options

--no-index

By default, search indexes are updated when you install, update, or uninstall packages. Use the --no-index option to not update search indexes after successful completion of these operations. Specifying this option might save some time if you are installing a large number of packages. When you are finished with all install, update, and uninstall operations, you can use pkg refresh to update the list of available packages and publisher metadata for each publisher specified. If no publishers are specified, the refresh is performed for all publishers. This option is available for the install, exact-install, uninstall, and update subcommands.

--no-refresh

When you specify the --no-refresh option, the repositories for the image's publishers are not contacted to retrieve the newest list of available packages and other metadata. This option is available for the install, exact-install, and update subcommands.