Using pkgrm in a Non-Global Zone
As the zone administrator, use the pkgrm utility in a non-global zone to remove a package. The following limitations apply:
pkgrm can only remove packages from the non-global zone.
The -G option cannot be used. If this option is used, pkgrm outputs an error message and the attempted operation fails.
The package cannot affect any area of the zone that is shared from the global zone.
The package must be set SUNW_PKG_ALLZONES=false.
The following steps are performed by the pkgrm utility:
Dependencies are checked on the non-global zone's package database. If the dependency check fails, then pkgrm fails and the zone administrator is notified. The check fails if either of the following conditions are true.
Any component of the package affects any area of the zone that is shared from the global zone.
The package is set SUNW_PKG_ALLZONES=true.
The package is removed from the zone.
The package database on the zone is updated.
Package Parameter Information
Setting Package Parameters for Zones
The SUNW_PKG_ALLZONES, SUNW_PKG_HOLLOW, and SUNW_PKG_THISZONE package parameters define the characteristics of packages on a system with zones installed. These parameters must be set so that packages can be administered on a system with non-global zones installed.
The following table lists the four valid combinations for setting package parameters. If you choose setting combinations that are not listed in the following table, those settings are invalid and the package will fail to install.
Ensure that you have set all three package parameters. You can leave all three package parameters blank. The package tools interpret a missing zone package parameter as if the setting were false, but not setting the parameters is strongly discouraged. By setting all three package parameters, you specify the exact behavior the package tools should exhibit when installing or removing the package.
Table 24-1 Valid Package Parameter Settings
SUNW_PKG_ALLZONES Setting | SUNW_PKG_HOLLOW Setting | SUNW_PKG_THISZONE Setting | Package Description |
---|---|---|---|
false | false | false | This is the default setting for packages that do not specify values for all the zone package parameters. A package with these settings can be installed in either the global zone or a non-global zone.
In both cases, the entire contents of the package is visible in all zones where the package is installed. |
false | false | true | A package with these settings can be installed in either the global zone or a non-global zone. If new non-global zones are created after the installation, the package is not propagated to these new non-global zones.
In both cases, the entire contents of the package is visible in the zone where the package is installed. |
true | false | false | A package with these settings can be installed in the global zone only. When the pkgadd command is run, the package is installed in the global zone and in all non-global zones. The entire contents of the package is visible in all zones. Note - Any attempt to install the package in a non-global zone fails. |
true | true | false | A package with these settings can only be installed in the global zone, by the global administrator. When the pkgadd command is run, the contents of the package is fully installed in the global zone. If a package has the package parameters set to these values, the package content itself is not delivered on any non-global zone. Only the package installation information necessary to make the package appear to be installed is installed on all non-global zones. This enables the installation of other packages to be installed that depend on this package. For package dependency checking purposes, the package appears to be installed in all zones.
Note - Any attempt to install the package in a non-global zone fails. |
SUNW_PKG_ALLZONES Package Parameter
The optional SUNW_PKG_ALLZONES package parameter describes the zone scope of a package. This parameter defines the following:
Whether a package is required to be installed on all zones
Whether a package is required to be identical in all zones
The SUNW_PKG_ALLZONES package parameter has two permissible values. These values are true and false. The default value is false. If this parameter is either not set or set to a value other than true or false, the value false is used.
The SUNW_PKG_ALLZONES parameter should be set to true for packages that must be the same package version and patch revision level across all zones. Any package that delivers functionality dependent on a particular Solaris kernel, for example, Solaris 10, should set this parameter to true. Any patch for a package must set the SUNW_PKG_ALLZONESparameter to the same value that is set in the installed package being patched. The patch revision level for any package that sets this parameter to true must be the same across all zones.
Packages that deliver functionality not dependent on a particular Solaris kernel, such as third-party packages or Sun compilers, should set this parameter to false. Any patch for a package that sets this parameter to false must also set this parameter to false. Both the package version or the patch revision level for any package that sets this parameter to false can be different between zones. For example, two non-global zones could each have a different version of a web server installed.
The SUNW_PKG_ALLZONES package parameter values are described in the following table.
Table 24-2 SUNW_PKG_ALLZONES Package Parameter Values
Value | Description |
---|---|
false | This package can be installed from the global zone to the global zone only, or to the global zone and to all non-global zones. The package can also be installed from any non-global zone to the same non-global zone.
If removed from the global zone, the package is not removed from other zones. The package can be removed from individual non-global zones.
|
true | If installed on the global zone, this package must also be installed on all non-global zones. If removed from the global zone, the package must also be removed from all non-global zones.
|
SUNW_PKG_HOLLOW Package Parameter
The SUNW_PKG_HOLLOW package parameter defines whether a package should be visible in any non-global zone if that package is required to be installed and be identical in all zones.
The SUNW_PKG_HOLLOW package parameter has two permissible values, true or false.
If SUNW_PKG_HOLLOW is either not set or set to a value other than true or false, the value false is used.
If SUNW_PKG_ALLZONES is set to false, the SUNW_PKG_HOLLOW parameter is ignored.
If SUNW_PKG_ALLZONES is set to false, then SUNW_PKG_HOLLOW cannot be set to true.
The SUNW_PKG_HOLLOW package parameter values are described in the following table.
Table 24-3 SUNW_PKG_HOLLOW Package Parameter Values
Value | Description |
---|---|
false | This is not a "hollow" package:
|
true | This is a "hollow" package:
|