System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones

Chapter 26 Adding and Removing Packages and Patches on a Solaris System With Zones Installed (Tasks)

Solaris 10 1/06: In this release, this chapter has been completely revised. This chapter documents current package and patch procedures on a system with installed non-global zones.

Solaris 10 6/06:A note was added to the procedure How to Add a Package to the Global Zone Only.

Solaris 10 8/07: A note was removed from the task How to Apply a Patch to the Global Zone Only.

For a complete listing of new Solaris 10 features and a description of Solaris releases, see Oracle Solaris 10 9/10 What’s New.

This chapter describes how to add and remove packages and patches on a system with zones installed. Other tasks associated with managing packages and patches, such as checking package parameter settings and obtaining package information, are also addressed. For an overview of patching and packaging concepts on a with zones installed, see Chapter 25, About Packages and Patches on a Solaris System With Zones Installed (Overview).

Adding and Removing Packages and Patches on a Solaris System With Zones Installed (Task Map)

Task 

Description 

For Instructions 

Add a package. 

Add a package on a system with zones installed. 

Adding a Package on a Solaris System With Zones Installed

Check package information. 

Check package information on a system with zones installed. 

Checking Package Information on a Solaris System With Zones Installed

Remove a package. 

Remove a package on a system with zones installed. 

Removing a Package From a Solaris System With Zones Installed

Apply a patch. 

Apply a patch on a system with zones installed. 

Applying a Patch to a Solaris System With Zones Installed

Remove a patch. 

Remove a patch on a system with zones installed. 

Removing a Patch on a System with Zones Installed

(Optional) Check the package parameter settings. 

When adding or removing packages, verify that the settings of the package parameters support the action you want to perform. 

Checking Package Parameter Settings on a System with Zones Installed

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:

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.

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


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

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

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

Checking Package Information on a Solaris System With Zones Installed

You can query the software package database for the global zone and non-global zones by using the pkginfo command. See the pkginfo(1) man page for more information about this command.

ProcedureHow to Check Package Information in the Global Zone Only

  1. To check the software package database for the global zone only, use pkginfo followed by the package name.


    global% pkginfo package_name
    

Example 26–1 Using the pkginfo Command in the Global Zone


global% pkginfo SUNWcsr SUNWcsu
system      SUNWcsr Core Solaris, (Root)
system      SUNWcsu Core Solaris, (Usr)

ProcedureHow to Check Package Information in a Specified Non-Global Zone Only

  1. To check the software package database in a specific non-global zone, log into the non-global zone and use pkginfo followed by the package name.


    my-zone% pkginfo package_name
    

Example 26–2 Using the pkginfo Command in a Non-Global Zone


my-zone% pkginfo SUNWcsr SUNWcsu
system      SUNWcsr Core Solaris, (Root)
system      SUNWcsu Core Solaris, (Usr)

Removing a Package From a Solaris System With Zones Installed

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

The SUNW_PKG_ALLZONES and SUNW_PKG_HOLLOW package parameter settings must match the correct value, either true or false, to remove 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.

ProcedureHow to Remove a Package From the Global Zone and 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. While in the global zone, run the pkgrm command followed by the package name.


    global# pkgrm package_name
    

ProcedureHow to Remove a Package From a Specified Non-Global Zone Only

To remove a package from a specified non-global zone only, the SUNW_PKG_ALLZONES package parameter must be set to false.

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 pkgrm command followed by the package name.


    my-zone# pkgrm package_name
    

Applying a Patch to a Solaris System With Zones Installed

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

ProcedureHow to Apply a Patch to the Global Zone Only


Note –

Solaris 10 3/05 through Solaris 10 11/06: If you are patching a package that was added by using the pkgadd command with the -G option, the package must be patched by using the patchadd command with the -G option. This restriction is removed in the Solaris 8/07 release.


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. Execute the patchadd command with the -Goption, followed by the patch ID.


    global# patchadd -G patch_id
    

ProcedureHow to Apply a Patch to the Global Zone and All Non-Global Zones

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

Also see Solaris 10 10/09: Zones Parallel Patching to Reduce Patching Time and Solaris 10 10/09: How to Patch Non-Global Zones in Parallel.

  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. Execute the patchadd command followed by the patch ID.


    global# patchadd patch_id
    

ProcedureHow to Apply a Patch to a Specified Non-Global Zone Only

To apply a patch to a specified non-global zone only, the SUNW_PKG_ALLZONES package parameter for all packages in the patch set must be set to false.

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, execute the patchadd command followed by the patch ID.


    my-zone# patchadd patch_id
    

ProcedureSolaris 10 10/09: How to Patch Non-Global Zones in Parallel

Set the number of non-global zones that will be patched in parallel in the patchadd configuration file /etc/patch/pdo.conf. When patching in the global zone has finished, the number of non-global zones set in num_proc= are patched together.

If running a release prior to Solaris 10 10/09, download patch 119254-66 or later revision (SPARC) or 119255-66 or later revision (x86).

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. (Optional, for releases prior to Solaris 10 10/09 only) Download patch 119254-66 (SPARC) or 119255-66 (x86).

  3. In the /etc/patch/pdo.conf file, set 6 non-global zones to be patched together in parallel on a system with 4 online CPUs.


    num_proc=6

    If there are more than six non-global zones on the system, the first six will be patched in parallel, then the remaining non-global zones will be patched as processes finish patching the first six non-global zones.

Removing a Patch on a System with Zones Installed

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

ProcedureHow to Remove a Patch From the Global Zone and 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. Execute the patchrm command followed by the patch ID.


    global# patchrm patch_id
    

ProcedureHow to Remove a Patch From a Specified Non-Global Zone Only

To remove a patch from a specified non-global zone only, the SUNW_PKG_ALLZONES package parameter for all packages in the patch set must be set to false.

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, execute the patchrm command followed by the patch ID.


    my-zone# patchrm patch_id
    

Checking Package Parameter Settings on a System with Zones Installed

Before you add or remove a software package, you can use the pkgparam command to check package parameter settings. This step is optional. This check also can be done when troubleshooting why a package is not added or removed as expected. For information about displaying package parameter values, see the pkgparam(1) man page.

Procedure(Optional) How to Check the Setting of a Package Already Installed on the System

  1. To check the package parameter setting of a package that is already installed in a global or non-global zone, use pkgparam followed by the package name and the name of the parameter.


    my-zone% pkgparam package_name SUNW_PKG_ALLZONES
    true
    my-zone% pkgparam package_name SUNW_PKG_HOLLOW
    false

Procedure(Optional) How to Check the Setting of a Package in Software on a CD-ROM

  1. To check the package parameter setting of an uninstalled package in software located on a CD-ROM, use pkgparam -d with the path of the CD-ROM followed by the package name and the name of the parameter.


    my-zone% pkgparam -d /cdrom/cdrom0/directory package_name SUNW_PKG_ALLZONES
    true
    my-zone% pkgparam -d /cdrom/cdrom0/directory package_name SUNW_PKG_HOLLOW 
    false