System Administration Guide: Virtualization Using the Solaris Operating System
Previous Next

Adding a Package on a Solaris System With Zones Installed

You can use the pkgadd system utility described in the pkgadd(1M) man page to perform the following tasks:

  • Add a package to the global zone only

  • Add a package to both the global zone and all non-global zones

  • Add a package that is already installed in the global zone to the non-global zones

  • Add a package to a specified non-global zone only

The SUNW_PKG_ALLZONES and SUNW_PKG_HOLLOW package parameter settings must match the correct value, either true or false, to add packages. Otherwise, the desired result will not be achieved. For more information about the effect of these package parameter settings, see About Packages and Zones. For more information about how to check these package parameter settings, see Checking Package Parameter Settings on a System with Zones Installed.

How to Add a Package to the Global Zone Only

To add a package to the global zone only, the SUNW_PKG_ALLZONES package parameter must be set to false.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. While in the global zone, run the pkgadd -d command followed by the location of the package, the -G option, and then the package name.
    • If installing the package from a CD-ROM, type:

      global# pkgadd -d /cdrom/cdrom0/directory -G package_name
    • If installing the package from a directory to which it has been copied, type:

      global# pkgadd -d disk1/image -G package_name

      where disk1 is the location where the package was copied.


    Note - 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.


How to Add a Package to the Global Zone and All Non-Global Zones

Do not use pkgadd option -G in this procedure.

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. While in the global zone, run the pkgadd -d command followed by the location of the package and then the package name.
    • If installing the package from a CD-ROM, type:

      global# pkgadd -d /cdrom/cdrom0/directory package_name
    • If installing the package from a directory to which it has been copied, type:

      global# pkgadd -d disk1/image package_name

      where disk1 is the location where the package was copied.

How to Add a Package That Is Installed in the Global Zone to All Non-Global Zones

You must be the global administrator in the global zone to perform this procedure.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. In the global zone, use pkgrm to remove the package.
  3. Add the package without using the -G option.

How to Add a Package to a Specified Non-Global Zone Only

To add a package to a specified non-global zone only, the SUNW_PKG_ALLZONES package parameter must be set to false. Do not use the pkgadd option -G in this procedure or the operation fails.

You must be the zone administrator in the non-global zone to perform this procedure.

  1. Log in to the non-global zone as the zone administrator.
  2. While in the non-global zone, my-zone in this procedure, run the pkgadd -d command followed by the location of the package and then the package name.
    • If installing the package from a CD-ROM, type:

      my-zone# pkgadd -d /cdrom/cdrom0/directory package_name
    • If installing the package from a directory to which it has been copied, type:

      my-zone# pkgadd -d disk1/image package_name

      where disk1 is the location where the package was copied.

Previous Next