<chapter id="z.pkginst.task-1"><title>Adding and Removing Packages and Patches
on a Solaris System With Zones Installed (Tasks)</title><highlights><para>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 <olink targetptr="z.pkginst.ov-1" remap="internal">Chapter&nbsp;24,
About Packages and Patches on a Solaris System With Zones Installed (Overview)</olink>.</para>
</highlights><sect1 id="z.pkginst.task-9"><title>Adding and Removing Packages and Patches
on a Solaris System With Zones Installed (Task Map)</title><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="33*"/><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><thead><row rowsep="1"><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Add a package.</para>
</entry><entry><para>Add a package on a system with zones installed.</para>
</entry><entry><para><olink targetptr="z.pkginst.task-2" remap="internal">Adding a Package on a Solaris System
With Zones Installed</olink></para>
</entry>
</row><row><entry><para>Check package information.</para>
</entry><entry><para>Check package information on a system with zones installed.</para>
</entry><entry><para><olink targetptr="z.pkginst.task-7" remap="internal">Checking Package Information on
a Solaris System With Zones Installed</olink></para>
</entry>
</row><row><entry><para>Remove a package.</para>
</entry><entry><para>Remove a package on a system with zones installed.</para>
</entry><entry><para><olink targetptr="z.pkginst.task-8" remap="internal">Removing a Package From a Solaris
System With Zones Installed</olink></para>
</entry>
</row><row><entry colname="colspec0"><para>Apply a patch.</para>
</entry><entry colname="colspec1"><para>Apply a patch on a system with zones installed.</para>
</entry><entry colname="colspec2"><para><olink targetptr="z.pkginst.task-34" remap="internal">Applying a Patch to a Solaris System
With Zones Installed</olink></para>
</entry>
</row><row><entry colname="colspec0"><para>Remove a patch.</para>
</entry><entry colname="colspec1"><para>Remove a patch on a system with zones installed.</para>
</entry><entry colname="colspec2"><para><olink targetptr="z.pkginst.task-42" remap="internal">Removing a Patch on a System with
Zones Installed</olink></para>
</entry>
</row><row><entry colname="colspec0"><para>(Optional) Check the package parameter settings.</para>
</entry><entry colname="colspec1"><para>When adding or removing packages, verify that the settings of the package
parameters support the action you want to perform.</para>
</entry><entry colname="colspec2"><para><olink targetptr="z.pkginst.task-10" remap="internal">Checking Package Parameter Settings
on a System with Zones Installed</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="z.pkginst.task-2"><title>Adding a Package on a Solaris System With
Zones Installed</title><para>You can use the <command>pkgadd</command> system utility described in
the <olink targetdoc="group-refman" targetptr="pkgadd-1m" remap="external"><citerefentry><refentrytitle>pkgadd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page to perform the following tasks:</para><itemizedlist><listitem><para>Add a package to the global zone only</para>
</listitem><listitem><para>Add a package to both the global zone and all non-global zones</para>
</listitem><listitem><para>Add a package that is already installed in the global zone
to the non-global zones</para>
</listitem><listitem><para>Add a package to a specified non-global zone only</para>
</listitem>
</itemizedlist><para>The <literal>SUNW_PKG_ALLZONES</literal> and <literal>SUNW_PKG_HOLLOW</literal> package
parameter settings must match the correct value, either <literal>true</literal> or <literal>false</literal>, to add packages. Otherwise, the desired result will not be
achieved. For more information about the effect of these package parameter
settings, see <olink targetptr="z.pkginst.ov-10" remap="internal">About Packages and Zones</olink>.
For more information about how to check these package parameter settings,
see <olink targetptr="z.pkginst.task-10" remap="internal">Checking Package Parameter Settings
on a System with Zones Installed</olink>.</para><task id="z.pkginst.task-3"><title>How to Add a Package to the Global Zone
Only</title><tasksummary><para>To add a package to the global zone only, the <literal>SUNW_PKG_ALLZONES</literal> package
parameter must be set to <literal>false</literal>.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.pkginst.task-step-13"><para>While in the global zone, run the <command>pkgadd</command> <option>d</option> command followed by the location of the
package, the <option>G</option> option, and then the package name.</para><itemizedlist><listitem><para>If installing the package from a CD-ROM, type:</para><screen>global# <userinput>pkgadd</userinput> <option>d</option> <userinput>/cdrom/cdrom0/<replaceable>directory</replaceable></userinput> <option>G</option> <userinput><replaceable>package_name</replaceable></userinput></screen>
</listitem><listitem><para>If installing the package from a directory to which it has
been copied, type:</para><screen>global# <userinput>pkgadd</userinput> <option>d</option> <userinput><replaceable>disk1</replaceable>/image</userinput> <option>G</option> <userinput><replaceable>package_name</replaceable></userinput></screen><para>where <replaceable>disk1</replaceable> is the location where the package
was copied.</para>
</listitem>
</itemizedlist><note><para>If the <command>pkgadd</command> utility is run without the <option>G</option> option and <literal>SUNW_PKG_THISZONE=true</literal>, then the specified
package is added to the current (global) zone by default.</para>
</note>
</step>
</procedure>
</task><task id="z.pkginst.task-5"><title>How to Add a Package to the Global Zone
and All Non-Global Zones</title><tasksummary><para>Do not use <command>pkgadd</command> option <option>G</option> in this
procedure.</para><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.pkginst.task-step-16"><para>While in the global zone, run the <command>pkgadd</command> <option>d</option> command followed by the location of the
package and then the package name.</para><itemizedlist><listitem><para>If installing the package from a CD-ROM, type:</para><screen>global# <userinput>pkgadd</userinput> <option>d</option> <userinput>/cdrom/cdrom0/<replaceable>directory</replaceable> <replaceable>package_name</replaceable></userinput></screen>
</listitem><listitem><para>If installing the package from a directory to which it has
been copied, type:</para><screen>global# <userinput>pkgadd</userinput> <option>d</option> <userinput><replaceable>disk1</replaceable>/image <replaceable>package_name</replaceable></userinput></screen><para>where <replaceable>disk1</replaceable> is the location where the package
was copied.</para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task><task id="z.pkginst.task-4"><title>How to Add a Package That Is Installed
in the Global Zone to All Non-Global Zones</title><tasksummary><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.pkginst.task-step-18"><para>In the global zone, use <command>pkgrm</command> to
remove the package.</para>
</step><step><para>Add  the package without using the <option>G</option> option.</para>
</step>
</procedure>
</task><task id="z.pkginst.task-6"><title>How to Add a Package to a Specified Non-Global
Zone Only</title><tasksummary><para>To add a package to a specified non-global zone only, the <literal>SUNW_PKG_ALLZONES</literal> package parameter must be set to <literal>false</literal>. Do not
use the <command>pkgadd</command> option <option>G</option> in this procedure
or the operation fails.</para><para>You must be the zone administrator in the non-global zone to perform
this procedure.</para>
</tasksummary><procedure><step><para>Log in to the non-global zone as the zone administrator. </para>
</step><step id="z.pkginst.task-step-20"><para>While in the non-global zone, <literal>my-zone</literal> in this procedure, run the <command>pkgadd</command> <option>d</option> command
followed by the location of the package and then the package name.</para><itemizedlist><listitem><para>If installing the package from a CD-ROM, type:</para><screen>my-zone# <userinput>pkgadd</userinput> <option>d</option> <userinput>/cdrom/cdrom0/<replaceable>directory</replaceable> <replaceable>package_name</replaceable></userinput></screen>
</listitem><listitem><para>If installing the package from a directory to which it has
been copied, type:</para><screen>my-zone# <userinput>pkgadd</userinput> <option>d</option> <userinput><replaceable>disk1</replaceable>/image <replaceable>package_name</replaceable></userinput></screen><para>where <replaceable>disk1</replaceable> is the location where the package
was copied.</para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task>
</sect1><sect1 id="z.pkginst.task-7"><title>Checking Package Information on a Solaris
System With Zones Installed</title><para>You can query the software package database for the global zone and
non-global zones by using the <command>pkginfo</command> command. See the <olink targetdoc="group-refman" targetptr="pkginfo-1" remap="external"><citerefentry><refentrytitle>pkginfo</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page for
more information about this command.</para><task id="z.pkginst.task-53"><title>How to Check Package Information in the
Global Zone Only</title><procedure remap="single-step"><step><para>To check the software package database for the global zone only,
use <command>pkginfo</command> followed by the package name.</para><screen>global% <userinput>pkginfo <replaceable>package_name</replaceable></userinput></screen>
</step>
</procedure><example id="fvzzw"><title>Using the <computeroutput>pkginfo</computeroutput> Command in the Global
Zone</title><screen>global% <userinput>pkginfo SUNWcsr SUNWcsu</userinput>
system      SUNWcsr Core Solaris, (Root)
system      SUNWcsu Core Solaris, (Usr)</screen>
</example>
</task><task id="z.pkginst.task-57"><title>How to Check Package Information in a
Specified Non-Global Zone Only</title><procedure remap="single-step"><step><para>To check the software package database  in
a specific non-global zone, log into the non-global zone and use <command>pkginfo</command> followed by the package name.</para><screen>my-zone% <userinput>pkginfo</userinput> <userinput><replaceable>package_name</replaceable></userinput></screen>
</step>
</procedure><example id="fwalt"><title>Using the <command>pkginfo</command> Command in a Non-Global Zone</title><screen>my-zone% <userinput>pkginfo SUNWcsr SUNWcsu</userinput>
system      SUNWcsr Core Solaris, (Root)
system      SUNWcsu Core Solaris, (Usr)</screen>
</example>
</task>
</sect1><sect1 id="z.pkginst.task-8"><title>Removing a Package From a Solaris System
With Zones Installed</title><para>You can use the <command>pkgrm</command> system utility described in
the <olink targetdoc="group-refman" targetptr="pkgrm-1m" remap="external"><citerefentry><refentrytitle>pkgrm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page to perform the following tasks:</para><itemizedlist><listitem><para>Remove a package from the global zone and all non-global zones</para>
</listitem><listitem><para>Remove a package from a specified non-global zone only</para>
</listitem>
</itemizedlist><para>The <literal>SUNW_PKG_ALLZONES</literal> and <literal>SUNW_PKG_HOLLOW</literal> package
parameter settings must match the correct value, either <literal>true</literal> or <literal>false</literal>, to remove packages. Otherwise, the desired result will not
be achieved. For more information about the effect of these package parameter
settings, see <olink targetptr="z.pkginst.ov-10" remap="internal">About Packages and Zones</olink>.
For more information about how to check these package parameter settings,
see <olink targetptr="z.pkginst.task-10" remap="internal">Checking Package Parameter Settings
on a System with Zones Installed</olink>.</para><task id="z.pkginst.task-25"><title>How to Remove a Package From the Global
Zone and All Non-Global Zones</title><tasksummary><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.pkginst.task-step-27"><para>While in the global zone, run the <command>pkgrm</command> command followed by the package name.</para><screen>global# <userinput>pkgrm <replaceable>package_name</replaceable></userinput></screen>
</step>
</procedure>
</task><task id="z.pkginst.task-31"><title>How to Remove a Package From a Specified
Non-Global Zone Only</title><tasksummary><para>To remove a package from a specified non-global zone only, the <literal>SUNW_PKG_ALLZONES</literal> package parameter must be set to <literal>false</literal>. </para><para>You must be the zone administrator in the non-global zone to perform
this procedure.</para>
</tasksummary><procedure><step><para>Log in to the non-global zone as the zone administrator. </para>
</step><step id="z.pkginst.task-step-33"><para>While in the non-global zone, <literal>my-zone</literal> in this procedure, run the <command>pkgrm</command> command followed
by the package name.</para><screen>my-zone# <userinput>pkgrm <replaceable>package_name</replaceable></userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="z.pkginst.task-34"><title>Applying a Patch to a Solaris System
With Zones Installed</title><para>You can use the <command>patchadd</command> system utility described
in the <olink targetdoc="group-refman" targetptr="patchadd-1m" remap="external"><citerefentry><refentrytitle>patchadd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page to perform the following tasks:</para><itemizedlist><listitem><para>Apply a patch to the global zone only</para>
</listitem><listitem><para>Apply a patch to the global zone and all non-global zones</para>
</listitem><listitem><para>Apply a patch to specified non-global zone only</para>
</listitem>
</itemizedlist><task id="z.pkginst.task-35"><title>How to Apply a Patch to the Global Zone
Only</title><tasksummary><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Execute the <command>patchadd</command> command with the <option>G</option>option,
followed by the patch ID.</para><screen>global# <userinput>patchadd -G <replaceable>patch_id</replaceable></userinput></screen>
</step>
</procedure>
</task><task id="fvjdc"><title>How to Apply a Patch to the Global Zone and All Non-Global
Zones</title><tasksummary><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step id="z.pkginst.task-step-37"><para>Execute the <command>patchadd</command> command
followed by the patch ID.</para><screen>global# <userinput>patchadd <replaceable>patch_id</replaceable></userinput></screen>
</step>
</procedure>
</task><task id="z.pkginst.task-38"><title>How to Apply a Patch to a Specified Non-Global
Zone Only</title><tasksummary><para>To apply a patch to a specified non-global zone only, the <literal>SUNW_PKG_ALLZONES</literal> package parameter for all packages in the patch set must be set
to <literal>false</literal>.</para><para>You must be the zone administrator in the non-global zone to perform
this procedure.</para>
</tasksummary><procedure><step><para>Log in to the non-global zone as the zone administrator. </para>
</step><step id="z.pkginst.task-step-40"><para>While in the non-global zone, <literal>my-zone</literal> in this procedure, execute the <command>patchadd</command> command
followed by the patch ID.</para><screen>my-zone# <userinput>patchadd <replaceable>patch_id</replaceable></userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="z.pkginst.task-42"><title>Removing a Patch on a System with Zones
Installed</title><para>You can use the <command>patchrm</command> system utility described
in the <olink targetdoc="group-refman" targetptr="patchrm-1m" remap="external"><citerefentry><refentrytitle>patchrm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page to perform the following task:</para><itemizedlist><listitem><para>Remove a patch from the global zone and all non-global zones</para>
</listitem><listitem><para>Remove a patch from a specified non-global zone only</para>
</listitem>
</itemizedlist><task id="funfg"><title>How to Remove a Patch From the Global Zone and All
Non-Global Zones</title><tasksummary><para>You must be the global administrator in the global zone to perform this
procedure.</para>
</tasksummary><procedure><step><para>Become superuser, or assume the Primary Administrator role.</para><para>To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-95" remap="external"><citetitle remap="section">Using the Solaris Management Tools With RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para>
</step><step><para>Execute the <command>patchrm</command> command followed by the
patch ID.</para><screen>global# <userinput>patchrm <replaceable>patch_id</replaceable></userinput></screen>
</step>
</procedure>
</task><task id="z.pkginst.task-46"><title>How to Remove a Patch From a Specified
Non-Global Zone Only</title><tasksummary><para>To remove a patch from a specified non-global zone only, the <literal>SUNW_PKG_ALLZONES</literal> package parameter for all packages in the patch set must be set
to <literal>false</literal>.</para><para>You must be the zone administrator in the non-global zone to perform
this procedure.</para>
</tasksummary><procedure><step><para>Log in to the non-global zone as the zone administrator. </para>
</step><step id="z.pkginst.task-step-48"><para>While in the non-global zone, <literal>my-zone</literal> in this procedure, execute the <command>patchrm</command> command
followed by the patch ID.</para><screen>my-zone# <userinput>patchrm <replaceable>patch_id</replaceable></userinput></screen>
</step>
</procedure>
</task>
</sect1><sect1 id="z.pkginst.task-10"><title>Checking Package Parameter Settings on
a System with Zones Installed</title><para>Before you add or remove a software package, you can use the <command>pkgparam</command> 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 <olink targetdoc="group-refman" targetptr="pkgparam-1" remap="external"><citerefentry><refentrytitle>pkgparam</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para><task id="z.pkginst.task-49"><title>(Optional) How to Check the Setting of
a Package Already Installed on the System</title><procedure remap="single-step"><step><para>To check the package parameter setting of a package that is already
installed in a global or non-global zone, use <command>pkgparam</command> followed
by the package name and the  name of the parameter.</para><screen>my-zone% <userinput>pkgparam <replaceable>package_name</replaceable> SUNW_PKG_ALLZONES</userinput>
true
my-zone% <userinput>pkgparam <replaceable>package_name</replaceable> SUNW_PKG_HOLLOW</userinput>
false</screen>
</step>
</procedure>
</task><task id="z.pkginst.task-50"><title>(Optional) How to Check the Setting of
a Package in Software on a CD-ROM</title><procedure remap="single-step"><step><para>To check the package parameter setting of an uninstalled package
in software located on a CD-ROM, use <command>pkgparam</command> <option>d</option> with
the path of the CD-ROM followed by the package name and the name of the parameter.</para><screen>my-zone% <userinput>pkgparam</userinput> <option>d</option> <userinput>/cdrom/cdrom0/<replaceable>directory</replaceable> <replaceable>package_name</replaceable> SUNW_PKG_ALLZONES</userinput>
true
my-zone% <userinput>pkgparam</userinput> <option>d</option> <userinput>/cdrom/cdrom0/<replaceable>directory</replaceable> <replaceable>package_name</replaceable> SUNW_PKG_HOLLOW</userinput> 
false </screen>
</step>
</procedure>
</task>
</sect1>
</chapter>