If a package is currently installed in the global zone and currently installed in only a subset of the non-global zones:
SUNW_PKG_ALLZONES must be set to false.
The package can be installed in all non-global zones. Existing instances in any non-global zone are updated to the revision being installed.
The package can be removed from the global zone.
The package can be removed from the global zone and from all non-global zones.
If a package is currently installed in the global zone and currently installed in all non-global zones, the package can be removed from the global zone and from all non-global zones.
These rules ensure the following:
Packages installed in the global zone are either installed in the global zone only, or installed in the global zone and all non-global zones.
Packages installed in the global zone and also installed in any non-global zone are the same across all zones.
Package Operations Possible in a Non-Global Zone
The package operations possible in any non-global zone are:
If a package is not currently installed in the non-global zone, the package can be installed only if SUNW_PKG_ALLZONES=false.
The package can be installed in the current zone, which is the non-global zone in this case, if SUNW_PKG_THISZONE=true.
If a package is currently installed in the non-global zone:
The package can be installed over the existing instance of the package only if SUNW_PKG_ALLZONES=false.
The package can be removed from the non-global zone only if SUNW_PKG_ALLZONES=false.
How Zone State Affects Patch and Package Operations
The following table describes what will happen when pkgadd, pkgrm, patchadd, and patchrm commands are used on a system with non-global zones in various states.
Zone State | Effect on Package and Patch Operations |
---|---|
Configured | Patch and package tools can be run. No software has been installed yet. |
Installed | Must be either transitioned to the ready state using zoneadm -z zonename ready, or booted using zoneadm -z zonename boot. After the zone is placed in the ready state or booted, the package and patch tools can be run. |
Ready | Patch and package tools can be run. |
Running | Patch and package tools can be run. |
Halted | Patch and package tools can be run. The system moves a halted zone to a new state, mounted. This new state is internal to the zone maintenance API. After patching has completed, the zone is reverted back to the halted state. |
Incomplete | A zone being installed or removed by zoneadm. Patch and package tools cannot be used. The tools cannot bring the zone into the appropriate state for using the tools. |
About Adding Packages in Zones
The pkgadd system utility described in the pkgadd(1M) man page is used to add packages on a Solaris system with zones installed.
Using pkgadd in the Global Zone
The pkgadd utility can be used with the -G option in the global zone to add the package to the global zone only. The package is not propagated to any other zones. Note that if SUNW_PKG_THISZONE=true, you do not have to use the -G option. If SUNW_PKG_THISZONE=false, the -G option will override it.
When you run the pkgadd utility in the global zone, the following actions apply.
The pkgadd utility is able to add a package:
To the global zone only, unless the package is SUNW_PKG_ALLZONES=true
To the global zone and to all non-global zones
To all non-global zones only, if the package is already installed in the global zone
To the current zone only, if SUNW_PKG_THISZONE=true
The pkgadd utility cannot add a package:
To any subset of the non-global zones
To all non-global zones, unless the package is already installed in the global zone
If the pkgadd utility is run without the -G option and SUNW_PKG_THISZONE=false , the specified package is added to all zones by default. The package is not marked as installed in the global zone only.
If the pkgadd utility is run without the -G option and SUNW_PKG_THISZONE=true, then the specified package is added to the current (global) zone by default. The package is marked as installed in the global zone only.
If the -G option is used, the pkgadd utility adds the specified package to the global zone only. The package is marked as installed in the global zone only. The package is not installed when any non-global zone is installed.
Adding a Package to the Global Zone and to All Non-Global Zones
To add a package to the global zone and to all non-global zones, execute the pkgadd utility in the global zone. As the global administrator, run pkgadd without the -G option.
A package can be added to the global zone and to all non-global zones without regard to the area affected by the package.
The following steps are performed by the pkgadd utility:
Package dependencies are checked on the global zone and on all non-global zones. If required packages are not installed in any zone, then the dependency check fails. The system notifies the global administrator, who is prompted whether to continue.
The package is added to the global zone.
The package database on the global zone is updated.
The package is added to each non-global zone and the database in the global zone is updated.
The package database on each non-global zone is updated.