<?Pub UDT _bookmark _target?><?Pub UDT __target_1 _target?><?Pub UDT registeredtm trademark?><?Pub EntList bull rArr sect?><?Pub CX solbook(book(title()bookinfo()chapter(15)?><chapter id="swmgrpkgscli-1"><?Pub Tag atict:info tracking="on" ref="4"?><?Pub Tag
atict:user user="sk23612" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="jonj" fullname="Juanita Heieck"?><?Pub Tag atict:user user="smorgan"
fullname=""?><?Pub Tag atict:user user="kathys" fullname="Kathy Slattery"?><?Pub Tag
atict:user user="cindys" fullname=""?><?Pub Tag atict:user user="cathleen"
fullname=""?><?Pub Tag atict:user user="eb151805" fullname="Juanita Heieck"?><?Pub Tag
atict:user user="jh118764" fullname="Juanita Heieck"?><?Pub Tag atict:user
user="lh136763" fullname="Laura Hartman"?><?Pub Tag atict:user user="wsm"
fullname=""?><title>Managing Software by Using Package Commands (Tasks)</title><highlights><para>This chapter describes how to add, verify, and remove software packages
by using the package commands.</para><itemizedlist><para>For information on the procedures associated with performing these tasks,
see:</para><listitem><para><olink targetptr="swmgrpkgscli-2" remap="internal">Adding and Removing Signed
Packages by Using the pkgadd Command (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="swmgrpkgscli-5" remap="internal">Managing Software Packages
by Using Package Commands (Task Map)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="swmgrpkgscli-2"><title>Adding and Removing Signed Packages by Using
the <command>pkgadd</command> Command (Task Map)</title><para>The following task map describes software management tasks that you
can perform with signed package commands.</para><informaltable frame="all"><tgroup cols="3" colsep="0" rowsep="0"><?PubTbl tgroup dispwid="6.86in"?><colspec colname="colspec0" colwidth="26.45*"/><colspec colname="colspec1" colwidth="26.45*"/><colspec colname="colspec2" colwidth="46.09*"/><thead><row><entry colsep="1" rowsep="1"><para>Task</para>
</entry><entry colsep="1" rowsep="1"><para>Description</para>
</entry><entry colsep="1" rowsep="1"><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para>Import a certificate.</para>
</entry><entry colsep="1" rowsep="1"><para>You can import a trusted certificate by using the <command>pkgadm addcert</command> command.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="swmgrpkgscli-3" remap="internal">How to Import a Trusted Certificate
From the Java Keystore (pkgadm addcert)</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Print the details of one or more certificates.</para>
</entry><entry colsep="1" rowsep="1"><para>You can print the details of a certificate by using the <command>pkgadm
listcert</command> command.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="swmgrpkgscli-55" remap="internal">How to Display Certificate Information
(pkgadm listcert)</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para> Remove a certificate.</para>
</entry><entry colsep="1" rowsep="1"><para>You can remove a certificate by using the <command>pkgadm removecert</command> command.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="swmgrpkgscli-10" remap="internal">How to Remove a Certificate (pkgadm
removecert)</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Set up a proxy server.</para>
</entry><entry colsep="1" rowsep="1"><para>Use this procedures for systems that are set up behind a firewall with
a proxy.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="swmgrpkgscli-18" remap="internal">How to Set Up a Proxy Server (pkgadd)</olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para>Add a signed package.</para>
</entry><entry colsep="1" rowsep="1"><para>After the root certificate is imported, you can add a signed package
by using he <command>pkgadd</command> command.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetptr="swmgrpkgscli-13" remap="internal">How to Add a Signed Package (pkgadd)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ewbdw"><title>Adding and Removing Signed Packages by Using the <command>pkgadd</command> Command</title><para>The following procedures explain how to add and remove signed packages
by using the <command>pkgadd</command> command.</para><task id="swmgrpkgscli-3"><title>How to Import a Trusted Certificate From
the Java Keystore (<command>pkgadm addcert</command>)</title><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-7"><para>Verify that the root certificate authority
(CA) certificate exists in the <trademark>Java </trademark> keystore.</para><screen># <userinput>keytool -storepass</userinput> <replaceable>storepass</replaceable> <userinput>-list -keystore</userinput> <replaceable>certfile</replaceable></screen><variablelist><varlistentry><term><command>keytool</command></term><listitem><para>Manages a Java keystore (database) of private keys and their
associated X.509 certificate chains that authenticate the corresponding public
keys. Also manages certificates from trusted entities. For more information
on the <command>keytool</command> utility, see <ulink url="http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/keytool.html" type="text">keytool-Key and Certificate Management Tool.</ulink></para>
</listitem>
</varlistentry><varlistentry><term><option>storepass</option> <replaceable>storepass</replaceable></term><listitem><para>Specifies the password that protects the integrity of the
keystore.</para>
</listitem>
</varlistentry><varlistentry><term><option>list</option></term><listitem><para>By default, prints the MD5 fingerprint of a certificate.</para>
</listitem>
</varlistentry><varlistentry><term><option>keystore</option> <replaceable>certfile</replaceable></term><listitem><para>Specifies the name and location of the persistent keystore
file.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="swmgrpkgscli-step-17"><para>Export the root CA certificate from
the Java keystore to a temporary file.</para><screen width="100"># <userinput>keytool -export -storepass</userinput> <replaceable>storepass</replaceable> <userinput>-alias verisignclass2g2ca -keystore 
/usr/java/jre/lib/security/cacerts <replaceable>certfile</replaceable> -file</userinput> <replaceable>filename</replaceable></screen><variablelist><varlistentry><term><option>export</option></term><listitem><para>Exports the trusted certificate.</para>
</listitem>
</varlistentry><varlistentry><term><option>storepass</option> <replaceable>storepass</replaceable></term><listitem><para>Specifies the password that protects the integrity of the
Java keystore.</para>
</listitem>
</varlistentry><varlistentry><term><option>alias</option> <literal>verisignclass2g2ca</literal></term><listitem><para>Identifies the alias of the trusted certificate.</para>
</listitem>
</varlistentry><varlistentry><term><option>keystore</option> <replaceable>certfile</replaceable></term><listitem><para>Specifies the name and location of the keystore file.</para>
</listitem>
</varlistentry><varlistentry><term><option>file</option> <replaceable>filename</replaceable></term><listitem><para>Identifies the file to hold the exported certificate.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Import a trusted certificate to the package keystore.</para><screen># <userinput>pkgadm addcert -t -f</userinput> <replaceable>format</replaceable> <replaceable>certfile</replaceable></screen><variablelist><varlistentry><term><option>t</option></term><listitem><para>Indicates that the certificate is a trusted CA certificate.
The output includes the details of the certificate, which the user is asked
to verify.</para>
</listitem>
</varlistentry><varlistentry><term><option>f</option> <replaceable>format</replaceable></term><listitem><para>Specifies the format of certificates and private keys. When
you import a certificate, it must be encoded using PEM or binary DER format.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>certfile</replaceable></term><listitem><para>Specifies the file that contains the certificate.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Remove the temporary file.</para><screen># <userinput>rm /tmp/<replaceable>file-name</replaceable></userinput></screen><para>For more information, see the <olink targetdoc="refman" targetptr="pkgadm-1m" remap="external"><citerefentry><refentrytitle>pkgadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</step>
</procedure><example id="swmgrpkgscli-4"><title>Importing a Trusted Certificate From the Java Keystore</title><para>The following example shows how to import a trusted certificate. In
this example, Sun's root CA certificate is imported from the Java keystore
into the package keystore by using the <command>keytool</command> command.</para><screen width="100"># <userinput>keytool -export -storepass changeit -alias verisignclass2g2ca \
-keystore /usr/java/jre/lib/security/cacerts -file /tmp/root.crt</userinput>
Certificate stored in file &lt;/tmp/root.crt&gt;</screen><screen width="100"># <userinput>pkgadm addcert -t -f der /tmp/root.crt</userinput>
     Keystore Alias: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
        Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
   Certificate Type: Trusted Certificate 
Issuer Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
     Validity Dates: &lt;May 18 00:00:00 1998 GMT&gt; - &lt;Aug  1 23:59:59 2028 GMT&gt;
MD5 Fingerprint: 2D:BB:E5:25:D3:D1:65:82:3A:B7:0E:FA:E6:EB:E2:E1
   SHA1 Fingerprint: B3:EA:C4:47:76:C9:C8:1C:EA:F2:9D:95:B6:CC:A0:08:1B:67:EC:9D

Are you sure you want to trust this certificate? <userinput>yes</userinput>
Trusting certificate &lt;/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O&gt;
Type a Keystore protection Password. <userinput>xxxxxx</userinput>
Press ENTER for no protection password (not recommended):
For Verification: Type a Keystore protection Password.
Press ENTER for no protection password (not recommended):
Certificate(s) from &lt;/tmp/root.crt&gt; are now trusted </screen>
</example>
</task><task id="swmgrpkgscli-55"><title>How to Display Certificate Information (<command>pkgadm listcert</command>)</title><procedure>&rolestep.sgm;<step><para>Display the contents of the package keystore.</para><screen># <userinput>pkgadm listcert -p <replaceable>passarg</replaceable></userinput></screen>
</step>
</procedure><example id="swmgrpkgscli-9"><title>Displaying Certificate Information</title><para>The following example shows how to display the details of a locally
stored certificate.</para><screen width="100"># <userinput>pkgadm listcert -P pass:test123</userinput>
Keystore Alias: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
        Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
   Certificate Type: Trusted Certificate
Issuer Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
Validity Dates: &lt;May 18 00:00:00 1998 GMT&gt; - &lt;Aug 1 23:59:59 2028 GMT&gt;
 MD5 Fingerprint: 2D:BB:E5:25:D3:D1:65:82:3A:B7:0E:FA:E6:EB:E2:E1
   SHA1 Fingerprint: B3:EA:C4:47:76:C9:C8:1C:EA:F2:9D:95:B6:CC:A0:08:1B:67:EC:9D </screen>
</example>
</task><task id="swmgrpkgscli-10"><title>How to Remove a Certificate (<command>pkgadm
removecert</command>)</title><procedure>&rolestep.sgm;<step><para>Remove the trusted certificate from the package keystore.</para><screen># <userinput>pkgadm removecert -n "</userinput><replaceable>certfile</replaceable><userinput>"</userinput></screen><para>The <command>removecert</command> <option>n</option> &ldquo;<replaceable>certfile</replaceable>&rdquo; option specifies the alias of the user certificate/key
pair or the alias of the trusted certificate.</para><note><para>View the alias names for certificates by using the <command>pkgadm
listcert</command> command.</para>
</note>
</step>
</procedure><example id="swmgrpkgscli-12"><title>Removing a Certificate</title><para>The following example shows how to remove a certificate.</para><screen width="100"># <userinput>pkgadm listcert</userinput>
    Keystore Alias: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
        Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
   Certificate Type: Trusted Certificate
Issuer Common Name: /C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O
Validity Dates: &lt;May 18 00:00:00 1998 GMT&gt; - &lt;Aug 1 23:59:59 2028 GMT&gt;
 MD5 Fingerprint: 2D:BB:E5:25:D3:D1:65:82:3A:B7:0E:FA:E6:EB:E2:E1
   SHA1 Fingerprint: B3:EA:C4:47:76:C9:C8:1C:EA:F2:9D:95:B6:CC:A0:08:1B:67:EC:9D 
# <userinput>pkgadm removecert -n "/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O"</userinput>
Enter Keystore Password: <replaceable>storepass</replaceable>
Successfully removed Certificate(s) with alias \
&lt;/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority - G2/O&gt;</screen>
</example>
</task><task id="swmgrpkgscli-18"><title>How to Set Up a Proxy Server (<command>pkgadd</command>)</title><tasksummary><para>If your system is behind a firewall with a proxy, you will need to set
up a proxy server before you can add a package from an HTTP server by using
the <command>pkgadd</command> command.</para>
</tasksummary><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-20"><para>Select one of the following methods
to specify a proxy server.</para><substeps><step><para>Specify the proxy server by using the <literal>http_proxy</literal>, <literal>HTTPPROXY</literal>, or <literal>HTTPPROXYPORT</literal> environment variable.</para><para>For example:</para><screen># <userinput>setenv http_proxy http:</userinput><replaceable>//mycache.domain:8080</replaceable></screen><para>Or, specify one of the following:</para><screen># <userinput>setenv HTTPPROXY</userinput> <replaceable>mycache.domain</replaceable>
# <userinput>setenv HTTPPROXYPORT</userinput> <replaceable>8080</replaceable></screen>
</step><step id="swmgrpkgscli-step-21"><para>Specify the proxy server on the <command>pkgadd</command> command line.</para><para>For example:</para><screen># <userinput>pkgadd -x</userinput> <replaceable>mycache.domain:8080</replaceable> <userinput>-d http:</userinput><replaceable>//myserver.com/pkg</replaceable> <replaceable>SUNWpkg</replaceable></screen>
</step><step id="swmgrpkgscli-step-22"><para>Create an administration file that includes
proxy server information.</para><para>For example:</para><screen># <userinput>cat /tmp/admin</userinput>
mail=
instance=unique
partial=ask
runlevel=ask
idepend=ask
rdepend=ask
space=ask
setuid=ask
conflict=ask
action=ask
networktimeout=60
networkretries=3
authentication=quit
keystore=/var/sadm/security
basedir=default
proxy=<replaceable>mycache.domain:8080</replaceable></screen><para>Then, identify the administration file by using the <command>pkgadd</command> <option>a</option> command. For example:</para><screen># <userinput>pkgadd -a</userinput> <replaceable>/tmp/admin</replaceable> <userinput>-d http:</userinput><replaceable>//myserver.com/pkg SUNWpkg</replaceable></screen>
</step>
</substeps>
</step>
</procedure>
</task><task id="swmgrpkgscli-13"><title>How to Add a Signed Package (<command>pkgadd</command>)</title><tasksummary><para>This procedure assumes that you have imported Sun's root CA certificate.
For more information, see <olink targetptr="swmgrpkgscli-3" remap="internal">How to Import
a Trusted Certificate From the Java Keystore (pkgadm addcert)</olink>.</para>
</tasksummary><procedure>&rolestep.sgm;<step><para>Add a signed package.</para><screen># <userinput>pkgadd -d</userinput> <replaceable>/pathname/device-name</replaceable></screen><para>The <option>d</option> <replaceable>device-name</replaceable> option
specifies the device from which the package is installed. The device can be
a directory, tape, diskette, or removable disk. The device can also be a data
stream created by the <command>pkgtrans</command> command.</para>
</step>
</procedure><example id="swmgrpkgscli-15"><title>Adding a Signed Package</title><para>The following example shows how to add a signed package that is stored
on the system.</para><screen># # <userinput>pkgadd -d /tmp/signed_pppd</userinput>
The following packages are available:
  1  SUNWpppd     Solaris PPP Device Drivers
                  (sparc) 11.10.0,REV=2003.05.08.12.24

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all
Enter keystore password:
## Verifying signature for signer &lt;User Cert 0&gt;

.
.
.</screen><para>The following example shows how to install a signed package using an <literal>HTTP</literal> URL as the device name. The URL must point to a stream-formatted
package.</para><screen># <userinput>pkgadd -d http://install/signed-video.pkg</userinput>

## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete
.
.
.</screen>
</example>
</task>
</sect1><sect1 id="swmgrpkgscli-5"><title>Managing Software Packages by Using Package
Commands (Task Map)</title><para>The following task map describes the software management tasks that
you can perform with the package commands for both signed and unsigned packages.</para><informaltable frame="all" pgwide="1" id="ewbei"><tgroup cols="3" colsep="1" rowsep="1"><?PubTbl tgroup dispwid="6.28in"?><colspec colname="colspec0" colwidth="28.91*"/><colspec colname="colspec1" colwidth="28.91*"/><colspec colname="colspec2" colwidth="41.18*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Add software packages to the local system.</para>
</entry><entry><para>You can add software packages to the local system by using the <command>pkgadd</command> command.</para>
</entry><entry><para><olink targetptr="swmgrpkgscli-23" remap="internal">How to Add Software Packages (pkgadd)</olink></para>
</entry>
</row><row><entry><para>Add software packages to a spool directory.</para>
</entry><entry><para>You can add software packages to a spool directory without actually
installing the software.</para>
</entry><entry><para><olink targetptr="swmgrpkgscli-31" remap="internal">Adding a Software Package to a Spool
Directory</olink></para>
</entry>
</row><row><entry><para>List information about all installed software packages.</para>
</entry><entry><para>You can list information about installed packages by using the <command>pkginfo</command> command.</para>
</entry><entry><para><olink targetptr="ewiaw" remap="internal">How to List Information About All Installed
Packages (pkginfo)</olink></para>
</entry>
</row><row><entry><para>Check the integrity of installed software packages.</para>
</entry><entry><para>You can verify the integrity of installed software packages by using
the <command>pkgchk</command> command.</para>
</entry><entry><para><olink targetptr="swmgrpkgscli-43" remap="internal">How to Check the Integrity of Installed
Software Packages (pkgchk)</olink></para>
</entry>
</row><row><entry><para>Check the integrity of an installed object.</para>
</entry><entry><para>You can verify the integrity of an installed object by using the <command>pkchk</command> command with the <option>p</option> and <option>P</option> options.
The <option>p</option> option specifies the full path name. The new <option>P</option> option
specifies a partial path name.</para>
</entry><entry><para><olink targetptr="eywvy" remap="internal">How to Check the Integrity of Installed Objects
(pkgchk -p, pkgchk -P)</olink></para>
</entry>
</row><row><entry><para>Remove software packages.</para>
</entry><entry><para>You can remove unneeded software packages by using the <command>pkgrm</command> command.</para>
</entry><entry><para><olink targetptr="swmgrpkgscli-50" remap="internal">How to Remove Software Packages (pkgrm)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ewbej"><title>Using Package Commands to Manage Software Packages</title><para>The following procedures explain how to manage software packages by
using package commands.</para><task id="swmgrpkgscli-23"><title>How to Add Software Packages (<command>pkgadd</command>)</title><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-25"><para>Remove any already installed packages
with the same names as the packages you are adding.</para><para><indexterm><primary><command>pkgadd</command> command</primary><secondary>adding packages (how to)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas=""><option>a</option> option (administration file)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas=""><option>d</option> option (device name)</secondary></indexterm><indexterm><primary>packages</primary><secondary>adding</secondary><seealso><command>pkgadd</command> command</seealso></indexterm>This step
ensures that the system keeps a proper record of software that has been added
and removed. Sometimes, you might want to maintain multiple versions of the
same application on the system. For strategies on maintaining multiple software
copies, see <olink targetptr="swmgrpkgsconcepts-35627" remap="internal">Guidelines for Removing
Packages (pkgrm)</olink>. For task information, see <olink targetptr="swmgrpkgscli-50" remap="internal">How to Remove Software Packages (pkgrm)</olink>.
 </para>
</step><step id="swmgrpkgscli-step-26"><para>Add a software package to the system.</para><screen># <userinput>pkgadd -a</userinput> <replaceable>admin-file</replaceable> <userinput>-d</userinput> <replaceable>device-name</replaceable> <replaceable>pkgid</replaceable> ...</screen><variablelist><varlistentry><term><option>a</option> <replaceable>admin-file</replaceable></term><listitem><para>(Optional) Specifies an administration file that the <command>pkgadd</command> command should check during the installation. For details about
using an administration file, see <olink targetptr="swmgrpkgsconcepts-3" remap="internal">Using
an Administration File</olink>.</para>
</listitem>
</varlistentry><varlistentry><term><option>d</option> <replaceable>device-name</replaceable></term><listitem><para>Specifies the absolute path to the software packages. <replaceable>device-name</replaceable> can be the path to a device, a directory, or a spool
directory. If you do not specify the path where the package resides, the <command>pkgadd</command> command checks the default spool directory (<filename>/var/spool/pkg</filename>). If the package is not there, the package installation fails. </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>pkgid</replaceable></term><listitem><para>(Optional) Is the name of one or more packages, separated
by spaces, to be installed. If omitted, the <command>pkgadd</command> command
installs all available packages from the specified device, directory, or spool
directory.</para>
</listitem>
</varlistentry>
</variablelist><para>If the <command>pkgadd</command> command encounters a problem during
installation of the package, it displays a message related to the problem,
followed by this prompt: </para><screen>Do you want to continue with this installation?</screen><para>Respond with <literal>yes</literal>, <literal>no</literal>, or <literal>quit</literal>. If more than one package has been specified, type <literal>no</literal> to
stop the installation of the package being installed. The <command>pkgadd</command> command
continues to install the other packages. Type <literal>quit</literal> to stop
the installation.</para>
</step><step id="swmgrpkgscli-step-27"><para>Verify that the package has been installed
successfully.</para><screen># <userinput>pkgchk -v</userinput> <replaceable>pkgid</replaceable></screen><para>If no errors occur, a list of installed files is returned. Otherwise,
the <command>pkgchk</command> command reports the error.</para>
</step>
</procedure><example id="swmgrpkgscli-28"><title>Adding Software Packages From a Mounted CD</title><para><indexterm><primary>adding</primary><secondary>a package from a mounted CD (example of)</secondary></indexterm><indexterm><primary>CD-ROM devices</primary><secondary>adding software from mounted CD</secondary><tertiary>example of</tertiary></indexterm><indexterm><primary>Sun software packages</primary><secondary>adding (example of)</secondary></indexterm>The following example shows how install
the <filename>SUNWpl5u</filename> package from a mounted Solaris 10 CD. The
example also shows how to verify that the package files were installed properly.
   </para><screen># <userinput>pkgadd -d /media/Solaris_11/Product SUNWpl5u</userinput>
	.
	.
	.
Installation of &lt;SUNWpl5u&gt; was successful.
# <userinput>pkgchk -v SUNWpl5u</userinput>
/usr
/usr/bin
/usr/bin/perl
/usr/perl5
/usr/perl5/5.8.4
.
.
.</screen>
</example><example id="swmgrpkgscli-29"><title>Installing Software Packages From a Remote Package Server</title><para>If the packages you want to install are available from a remote system,
you can manually mount the directory that contains the packages (in package
format) and install packages on the local system.</para><para><indexterm><primary>adding</primary><secondary>a package, example of</secondary></indexterm><indexterm><primary>remote package server</primary><secondary>software installation from (example of)</secondary></indexterm>The following example
shows how to install software packages from a remote system. In this example,
assume that the remote system named <filename>package-server</filename> has
software packages in the <filename>/latest-packages</filename> directory.
The <command>mount</command> command mounts the packages locally on <filename>/mnt</filename>. The <command>pkgadd</command> command installs the <filename>SUNWpl5u</filename> package.  </para><screen># <userinput>mount -F nfs -o ro package-server:/latest-packages /mnt</userinput>
# <userinput>pkgadd -d /mnt SUNWpl5u</userinput>
	.
	.
	.
Installation of &lt;SUNWpl5u&gt; was successful.</screen><para>If the automounter is running at your site, you do not need to mount
the remote package server manually. Instead, use the automounter path, in
this case, <filename>/net/package-server/latest-packages</filename>, as the
argument to the <command>-d</command> option. </para><screen># <userinput>pkgadd -d /net/package-server/latest-packages SUNWpl5u</userinput>
	.
	.
	.
Installation of &lt;SUNWpl5u&gt; was successful.</screen>
</example><example id="ewiay"><title>Installing Software Packages From a Remote Package Server by Specifying
an Administration File</title><para><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas="pkgadd command:a option (administration file)"><option>a</option> option (administration file)</secondary></indexterm><indexterm><primary><literal>noask_pkgadd</literal> administration file</primary></indexterm><indexterm><primary>remote package server</primary><secondary>software installation from</secondary></indexterm><indexterm><primary>adding</primary><secondary>packages from remote package server (example of)</secondary></indexterm><indexterm><primary>Sun software packages</primary><secondary>installing</secondary></indexterm>This
example is similar to the previous example, except that it uses the <option>a</option> option
and specifies an administration file named <filename>noask-pkgadd</filename>,
which is illustrated in <olink targetptr="swmgrpkgs-19113" remap="internal">Avoiding User Interaction
When Adding Packages (pkgadd)</olink>. In this example, assume that the  <filename>noask-pkgadd</filename> administration file is in the default location, <filename>/var/sadm/install/admin</filename>.  </para><screen># <userinput>pkgadd -a noask-pkgadd -d /net/package-server/latest-packages SUNWpl5u</userinput>
	.
	.
	.
Installation of &lt;SUNWpl5u&gt; was successful.</screen>
</example><example id="swmgrpkgscli-30"><title>Installing Software Packages From an <literal>HTTP</literal> URL</title><para><indexterm><primary><command>pkgadd</command> command</primary><secondary>adding packages (how to)</secondary><tertiary>using an HTTP URL</tertiary></indexterm>The
following example shows how to install a package using an <literal>HTTP</literal> URL
as the device name. The URL must point to a stream-formatted package.</para><screen># <userinput>pkgadd -d http://install/xf86-4.3.0-video.pkg</userinput>

## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete


The following packages are available:
  1  SUNWxf86r     XFree86 Driver Porting Kit (Root)
                   (i386) 4.3.0,REV=0.2003.02.28
  2  SUNWxf86u     XFree86 Driver Porting Kit (User)
                   (i386) 4.3.0,REV=0.2003.02.28

.
.
.</screen>
</example>
</task><sect2 id="swmgrpkgscli-31"><title>Adding a Software Package to a Spool Directory</title><para><indexterm><primary sortas="var/spool/pkg directory"><filename>/var/spool/pkg</filename> directory</primary></indexterm>For convenience, you can copy frequently
installed packages to a spool directory. If you copy packages to the default
spool directory, <filename>/var/spool/pkg</filename>, you do not need to specify
the source location of the package (<option>d</option> <replaceable>device-name</replaceable> argument)
when you use the <command>pkgadd</command> command. The <command>pkgadd</command> command,
by default, checks the <filename>/var/spool/pkg</filename> directory for any
packages that are specified on the command line. Note that copying packages
to a spool directory is not the same as installing the packages on a system.</para><task id="swmgrpkgscli-32"><title>How to Add Software Packages to a Spool
Directory (<command>pkgadd</command>)</title><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-34"><para>Remove any already spooled packages
with the same names as the packages you are adding.</para><para><indexterm><primary>spool directories</primary><secondary>installing software packages to (how to)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary>spool directories and</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas=""><option>d</option> option (device name)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas=""><option>s</option> option (spool directory)</secondary></indexterm><indexterm><primary>verifying</primary><secondary>software package installation</secondary><tertiary><command>pkginfo</command> command</tertiary></indexterm><indexterm><primary>verifying</primary><secondary>software package installation with <command>pkginfo</command> command</secondary></indexterm>For information on removing spooled packages, see <olink targetptr="swmgrpkgscli-54" remap="internal">Example&nbsp;20&ndash;20</olink>. </para>
</step><step id="swmgrpkgscli-step-35"><para>Add a software package to a spool directory.</para><screen># <userinput>pkgadd -d</userinput> <replaceable>device-name</replaceable> <userinput>-s</userinput> <replaceable>spooldir</replaceable> <replaceable>pkgid</replaceable> ...</screen><variablelist><varlistentry><term><option>d</option> <replaceable>device-name</replaceable></term><listitem><para>Specifies the absolute path to the software packages. <replaceable>device-name</replaceable> can be the path to a device, a directory, or a spool
directory.</para>
</listitem>
</varlistentry><varlistentry><term><option>s</option> <replaceable>spooldir</replaceable></term><listitem><para>Specifies the name of the spool directory where the package
will be spooled. You must specify a <replaceable>spooldir</replaceable>. </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>pkgid</replaceable></term><listitem><para>(Optional) Is the name of one or more packages, separated
by spaces, to be added to the spool directory. If omitted, the <command>pkgadd</command> command
copies all available packages.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step id="swmgrpkgscli-step-36"><para>Verify that the package has been copied
successfully to the spool directory.</para><screen>$ <userinput>pkginfo -d</userinput> <replaceable>spooldir</replaceable><userinput>| grep</userinput> <replaceable>pkgid</replaceable></screen><para>If <replaceable>pkgid</replaceable> was copied correctly, the <command>pkginfo</command> command returns a line of information about the <replaceable>pkgid</replaceable>.
Otherwise, the <command>pkginfo</command> command returns the system prompt. </para>
</step>
</procedure><example id="swmgrpkgscli-37"><title>Setting Up a Spool Directory From a Mounted CD</title><para><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas=""><option>d</option> option (device name)</secondary></indexterm><indexterm><primary>software packages</primary><secondary>installing from a spool directory (example of)</secondary></indexterm>The following example shows how to transfer
the <literal>SUNWman</literal> package from a mounted SPARC based Solaris
10 CD to the default spool directory (<filename>/var/spool/pkg</filename>).
  </para><screen># <userinput>pkgadd -d /media/Solaris_11/Product -s /var/spool/pkg SUNWman</userinput>
Transferring &lt;SUNWman&gt; package instance</screen>
</example><example id="swmgrpkgscli-38"><title>Setting Up a Spool Directory From a Remote Software Package Server</title><para>If packages you want to copy are available from a remote system, you
can manually mount the directory that contains the packages, in package format,
 and copy them to a local spool directory.</para><para><indexterm><primary>remote package server</primary><secondary>adding packages to a spool directory (example of)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary sortas="pkgadd command:s option (spool directory)"><option>s</option> option (spool directory)</secondary></indexterm>The following example shows the commands
for this scenario. In this example, assume that the remote system named <literal>package-server</literal> has software packages in the <filename>/latest-packages</filename> directory.
The <command>mount</command> command mounts the package directory locally
on <filename>/mnt</filename>. The <command>pkgadd</command> command copies
the <literal>SUNWpl5p</literal> package from <filename>/mnt</filename> to
the default spool directory (<filename>/var/spool/pkg</filename>).  </para><screen># <userinput>mount -F nfs -o ro package-server:/latest-packages /mnt</userinput>
# <userinput>pkgadd -d /mnt -s /var/spool/pkg SUNWpl5p</userinput>
Transferring &lt;SUNWpl5p&gt; package instance</screen><para>If the automounter is running at your site, you do not have to mount
the remote package server manually. Instead, use the automounter path, in
this case, <filename>/net/package-server/latest-packages</filename>, as the
argument to the <option>d</option> option. </para><screen># <userinput>pkgadd -d /net/package-server/latest-packages -s /var/spool/pkg SUNWpl5p</userinput>
Transferring &lt;SUNWpl5p&gt; package instance</screen>
</example><example id="swmgrpkgscli-39"><title>Installing Software Packages From the Default Spool Directory</title><para><indexterm><primary sortas="var/spool/pkg directory"><filename>/var/spool/pkg</filename> directory</primary></indexterm><indexterm><primary sortas="pkg directory"><filename>/pkg</filename> directory</primary></indexterm><indexterm><primary>software packages</primary><secondary>installing</secondary></indexterm><indexterm><primary>adding</primary><secondary>packages from a spool directory (example of)</secondary></indexterm><indexterm><primary>spool directories</primary><secondary>installing software packages to (example of)</secondary></indexterm><indexterm><primary><command>pkgadd</command> command</primary><secondary>spool directories and (example of)</secondary></indexterm>The following
example shows how to install the <literal>SUNWpl5p</literal> package from
the default spool directory. When no options are used, the <command>pkgadd</command> command
searches the <filename>/var/spool/pkg</filename> directory for the named packages.
 </para><screen># <userinput>pkgadd SUNWpl5p</userinput>
	.
	.
	.
Installation of &lt;SUNWpl5p&gt; was successful.</screen>
</example>
</task>
</sect2><task id="ewiaw"><title>How to List Information About All Installed Packages
(<command>pkginfo</command>)</title><procedure remap="single-step"><step><para><indexterm><primary><command>pkginfo</command> command</primary><secondary>how to use</secondary></indexterm><indexterm><primary>displaying</primary><secondary>installed software information</secondary></indexterm>List information
about installed packages by using the <command>pkginfo</command> command.</para><screen>$ <userinput>pkginfo</userinput></screen>
</step>
</procedure><example id="ewiaz"><title>Listing Installed Packages</title><para><indexterm><primary><command>pkginfo</command> command</primary><secondary>displaying all packages installed (example of)</secondary></indexterm><indexterm><primary>listing</primary><secondary>package information (example of)</secondary></indexterm>This example shows how to list all packages
installed on a local system, whether that system is a stand-alone system or
a server. The output shows the primary category, package name, and the description
of the package. </para><screen>$ <userinput>pkginfo</userinput>
system      SUNWaccr       System Accounting, (Root)
system      SUNWaccu       System Accounting, (Usr)
system      SUNWadmap      System administration applications
system      SUNWadmc       System administration core libraries
.
.
.</screen>
</example><example id="ewiba"><title>Displaying Detailed Information About Software Packages</title><para>This example shows how to list all packages installed on a system by
specifying the long format, which includes all available information about
the designated packages.</para><screen>$ <userinput>pkginfo -l SUNWcar</userinput>
   PKGINST:  SUNWcar
      NAME:  Core Architecture, (Root)
  CATEGORY:  system
      ARCH:  sparc.sun4u
   VERSION:  11.9.0,REV=2002.04.06.15.27
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  core software for a specific hardware platform group
    PSTAMP:  leo20031003183400
  INSTDATE:  Feb 20 2004 16:57
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:      114 installed pathnames
                  36 shared pathnames
                  40 directories
                  57 executables
               21469 blocks used (approx)</screen>
</example>
</task><task id="swmgrpkgscli-43"><title>How to Check the Integrity of Installed
Software Packages (<command>pkgchk</command>)</title><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-45"><para>Check the status of an installed package.</para><itemizedlist><listitem><para>To check the file attributes and contents, type the following:</para><screen># <userinput>pkgchk -a</userinput>| <userinput>-c -v</userinput> <replaceable>pkgid</replaceable> ...</screen>
</listitem><listitem><para>To specify the absolute path of the spool directory, type
the following:</para><screen># <userinput>pkgchk -d</userinput> <replaceable>spooldir pkgid</replaceable> ...</screen>
</listitem>
</itemizedlist><variablelist><varlistentry><term><option>a</option></term><listitem><para>Specifies to audit only the file attributes (the permissions),
rather than the file attributes and the contents, which is the default.</para>
</listitem>
</varlistentry><varlistentry><term><option>c</option></term><listitem><para>Specifies to audit only the file contents, rather than the
file contents and attributes, which is the default.</para>
</listitem>
</varlistentry><varlistentry><term><option>v</option></term><listitem><para>Specifies verbose mode, which displays file names as they
are processed.</para>
</listitem>
</varlistentry><varlistentry><term><option>d</option> <replaceable>spooldir</replaceable></term><listitem><para>Specifies the absolute path of the spool directory.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>pkgid</replaceable></term><listitem><para>(Optional) Is the name of one or more packages, separated
by spaces. If you do not specify a <replaceable>pkgid</replaceable>, all the
software packages installed on the system are checked.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="swmgrpkgscli-46"><title>Checking the Contents of Installed Software Packages</title><para>The following example shows how to check the contents of a package.</para><screen># <userinput>pkgchk -c SUNWbash</userinput></screen><para>If no errors occur, the system prompt is returned. Otherwise, the <command>pkgck</command> command reports the error.</para>
</example><example id="swmgrpkgscli-47"><title>Checking the File Attributes of Installed Software Packages</title><para><indexterm><primary>files</primary><secondary>verifying attributes for newly installed packages</secondary></indexterm><indexterm><primary>checking</primary><secondary>installed packages (example of)</secondary></indexterm>The following
example shows how to check the file attributes of a package. </para><screen># <userinput>pkgchk -a SUNWbash</userinput></screen><para>If no errors occur, the system prompt is returned. Otherwise, the <command>pkgck</command> command reports the error.</para>
</example><example id="swmgrpkgscli-48"><title>Checking Software Packages Installed in a Spool Directory</title><para><indexterm><primary>spool directories</primary><secondary>installing software packages to (example of)</secondary></indexterm><indexterm><primary>adding</primary><secondary>packages to a spool directory (example of)</secondary></indexterm><indexterm><primary><command>pkgchk</command> command</primary><secondary>using (example of)</secondary></indexterm><indexterm><primary>verifying</primary><secondary>software installation (example of)</secondary></indexterm>The
following example shows how to check a software package that was copied to
a spool directory (<filename>/export/install/packages</filename>).     </para><screen># <userinput>pkgchk -d /export/install/packages</userinput>
## checking spooled package &lt;SUNWadmap&gt;
## checking spooled package &lt;SUNWadmfw&gt;
## checking spooled package &lt;SUNWadmc&gt;
## checking spooled package &lt;SUNWsadml&gt;</screen><para>The checks made on a spooled package are limited because not all information
can be audited until a package is installed. </para>
</example>
</task><task id="eywvy"><title>How to Check the Integrity of Installed Objects (<command>pkgchk -p, pkgchk -P</command>)</title><tasksummary><para>This procedure explains how to use the <command>pkgchk</command> command
to check the integrity of installed objects. The new <option>P</option> option
enables you to specify a partial path. This option has been added to assist
you in mapping files to packages. Use this option with the <option>l</option> option
to list the information about the files that contain the partial path. Use
the <option>p</option> option to check the integrity of installed objects
by specifying the full path. For more information, see the <olink targetdoc="refman" targetptr="pkgchk-1m" remap="external"><citerefentry><refentrytitle>pkgchk</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure>&rolestep.sgm;<step id="eywwa"><para>Check the integrity of an installed object.</para><itemizedlist><listitem><para>To verify the integrity of an installed object for a full
path name or path names, type the following:</para><screen># <userinput>pkgchk -lp <replaceable>path-name</replaceable></userinput></screen>
</listitem><listitem><para>To verify the integrity of an installed object for a partial-path
name or path names, type the following:</para><screen># <userinput>pkgchk -lP  <replaceable>partial-path-name</replaceable></userinput></screen>
</listitem>
</itemizedlist><variablelist><varlistentry><term><option>p</option> <replaceable>path</replaceable></term><listitem><para>Checks the accuracy only of the path name or path names that
are listed.  Path can be one or more path names separated by commas. Specifies
to audit only the file attributes (the permissions), rather than the file
attributes and the contents, which is the default.</para>
</listitem>
</varlistentry><varlistentry><term><option>P</option> <replaceable>partial-path</replaceable></term><listitem><para>Checks the accuracy of only the partial  path name or path
names that are listed.  The partial-path can be one or more partial path names
separated by commas. Matches any path name that contains the string contained
in the partial path. Specifies to audit only the file contents, rather than
the file contents and attributes, which is the default.</para>
</listitem>
</varlistentry><varlistentry><term><option>l</option></term><listitem><para>Lists information about the selected files that make up a
package.  This option is not compatible with the <option>a</option>, <option>c</option>, <option>f</option>, <option>g</option>, and <option>v</option> options. Specifies
verbose mode, which displays file names as they are processed.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="eywwc"><title>Checking the Integrity of an Installed Object by Specifying a Full
Path Name</title><para>This example shows you how to use the <command>pkgchk</command> <option>lp</option> command
to check the contents/attributes of an object on a file system by a specifying
the full path name. The <option>l</option> option lists information on the
selected files that make up a package.</para><screen># <userinput>pkgchk -lp /usr/sbin/pkgadd</userinput>
Pathname: /usr/sbin/pkgadd
Type: regular file
Expected mode: 0555
Expected owner: root
Expected group: sys
Expected file size (bytes): 867152
Expected sum(1) of contents: 45580
Expected last modification: Jul 02 02:20:34 2004
Referenced by the following packages:
        SUNWpkgcmdsu   
Current status: installed</screen>
</example><example id="eywwg"><title>Checking the Integrity of an Installed Object by Specifying a Partial
Path Name</title><para>This example shows you how to use the <command>pkgchk</command> <option>lP</option> command
to check the contents/attributes of an object on a file system by a specifying
a partial path name, such as a file or directory name. The <option>l</option> option
lists information on the selected files that make up a package.</para><screen># <userinput>pkgchk -lP /sbin/pkgadd</userinput>
Pathname: /usr/sbin/pkgadd
Type: regular file
Expected mode: 0555
Expected owner: root
Expected group: sys
Expected file size (bytes): 867152
Expected sum(1) of contents: 45580
Expected last modification: Jul 02 02:20:34 2004
Referenced by the following packages:
        SUNWpkgcmdsu   
Current status: installed

Pathname: /usr/sbin/pkgask
Type: linked file
Source of link: ../../usr/sbin/pkgadd
Referenced by the following packages:
        SUNWpkgcmdsu   
Current status: installed</screen>
</example>
</task><sect2 id="swmgrpkgscli-49"><title>Removing Software Packages</title><para>To remove or uninstall a software package, use the associated tool that
you used to add or install a software package. For example, if you used the
Solaris installation GUI to install software, use the Solaris installation
GUI to uninstall software.</para><caution><para>Do no use the <command>rm</command> command to remove software
packages. Doing so will result in inaccuracies in the database that keeps
track of all installed packages on the system.</para>
</caution>
</sect2><task id="swmgrpkgscli-50"><title>How to Remove Software Packages (<command>pkgrm</command>)</title><procedure>&rolestep.sgm;<step id="swmgrpkgscli-step-52"><para>Remove an installed package.</para><screen># <userinput>pkgrm</userinput> <replaceable>pkgid</replaceable> ...</screen><para><replaceable>pkgid</replaceable> identifies the name of one or more
packages, separated by spaces, to be removed. If omitted, the <command>pkgrm</command>command
removes all available packages.</para>
</step>
</procedure><example id="swmgrpkgscli-53"><title>Removing Software Packages</title><para>This example shows how to remove a package.</para><screen># <userinput>pkgrm SUNWctu</userinput>

The following package is currently installed:
   SUNWctu         Netra ct usr/platform links (64-bit)
                   (sparc.sun4u) 11.9.0,REV=2001.07.24.15.53

Do you want to remove this package? <userinput>y</userinput>

## Removing installed package instance &lt;SUNWctu&gt;
## Verifying package dependencies.
## Processing package information.
## Removing pathnames in class &lt;none&gt;
.
.
.</screen>
</example><example id="swmgrpkgscli-54"><title>Removing a Spooled Software Package</title><para>This example shows how to remove a spooled package.</para><screen># <userinput>pkgrm -s /export/pkg SUNWaudh</userinput>
The following package is currently spooled:
   SUNWaudh        Audio Header Files
                   (sparc) 11.10.0,REV=2003.08.08.00.03
Do you want to remove this package? <userinput>y</userinput>
Removing spooled package instance &lt;SUNWaudh&gt;</screen>
</example>
</task>
</sect1>
</chapter><?Pub *0000051415 0?>