006 - Packages and Patches (2.8)

Exam Objective 2.8: Perform Solaris 10 OS package administration using command-line interface commands and manage software patches for the Solaris OS, including preparing for patch administration and installing and removing patches using the patchadd and patchrm commands.

Performing Package Administration
The application software for Solaris OS is delivered in units called packages. A package is a set of files and directories in a defined format.

Commands for package management
  • pkgask : Used to save the responses
  • pkgadd : Adds (installs) a software package.
  • pkgchk : Checks a package installation.
  • pkginfo : Lists the package information.
  • pkgparam : Displays the parameter values for a software package.
  • pkgrm : Removes a software package.
  • pkgtrans : Translates a package from one format to another
Installing a Package
the pkgadd command interprets the control files of the software package and then uncompresses them and installs the product files onto the system's local disk.
pkgadd [-n] [-a ] [-d ] [-G] [-r ] [-R ] [] []
-a . This indicates to use the installation administration file specified by instead of the default file.
-d . This indicates that the package to be installed should be copied from the device specified by
-G. This instructs the user to add the package only to the current zone.
-n. This specifies the installation mode to be non-interactive, and the list of the installed files is not displayed.
-r . This specifics the full path to the file that contains the responses from the previous pkgask command.
-R . This specifics the full path to the directory to be used as the root for installation.
. This is an alternative to the -d option
. This lists the package instances to be installed.

On occasion you may just want to copy the packages to the system for a possible installation at a later time. The default spool directory is /var/spool/pkg.
pkgadd -d -s

Checking a Package
the pkgchk command to check the accuracy of installed files, including the integrity of directory structures and files in a package.
pkgchk [-a|-c] -1] [-p [-v]
-a|c. The -a option means check the file attributes only and not the file contents, whereas the -c option means check the file contents only and not the file attributes. The default is to check both the file attributes and the file contents.
-l. This option specifies to list the information about the files contained in the package.
-p . This option specifies to limit the check to the files
-v. the verbose mode.
. This option specifies the space-delimited list of packages. By default, all the installed packages on the system are checked.

SCENARIO & SOLUTION
to check the content of an installed
pkgchk -c SUNWbash
to check the file attributes of an installed package
pkgchk -a SUNWPython
to check the software packages that have not yet been installed
pkgchk -d /var/install/packages

Retrieving Information about Packages
the pkginfo command to retrieve information about software packages, displays the primary category, package instance, and the names of all completely and partially installed packages—one line per package
pkginfo [-i|-p] [-1 |-q|-x] [-c ] []
-i|-p. The -i option means display information only about the fully installed packages, whereas the -p option means display information only about the partially installed packages.
-l|-q|-x. The -l option specifies the long display format, the -q option specifies do not display any information (used by programs), and the -x option specifies an extracted listing of package information.
-c . This option only displays packages whose category is included in the list specified by .

Removing a Package
the pkgrm command to remove a completely or partially installed package from the system.
pkgrm [-a ] [-A] [-n] []
-a . This option indicates to use the installation administration file specified by instead of the default file.
-A. This option instructs to remove all the files of the package including those shared by other packages.
-n. This option specifies the non-interactive mode

you can remove the spooled packages by:
pkgrm -s

Performing Patch Administration
A patch is a collection of files and directories that may replace or update existing files and directories that are preventing proper execution of the existing software.
http://sunsolve.sun.com

patchadd [-d] [-G] [-u] [-B ] []
-d. Do not back up the files to be patched
-G. Adds patches to the packages in the current zone only.
-u. Turns off file validation.
-B . Saves the backout data to a directory whose full path is specified by .
. Specifies the source from which to retrieve the patch,
. Specifies the destination to which the patch is to be applied.

to find out which patches are currently installed:
patchadd -p

SCENARIO & SOLUTION
Obtain information about all the patches
patchadd -p.
Find out if a particular patch.
patchadd -p | grep 113029.
Install a patch
patchadd /var/sadm/spool/105754-03.
Verify that the patch has been installed.
patchadd -p | 105754.
Note that the patchadd command cannot apply a patch under the following conditions:
- The package is not fully installed on the system.
- The architecture of the patch package differs from the architecture of the system on which it is being installed.
- The version of the patch package does not match the version of the corresponding installed package.
- A patch with the same base code and a higher revision number has already been applied.
- A patch that makes this patch obsolete has already been applied.
- The patch to be applied is incompatible with a patch that has already been applied to the system.
- The patch to be applied depends on another patch that has not yet been applied.

to get the revision information about the patches installed on your system:
showrev -p

Removing Patches
patchrm [-f] [-G] -B ]
-f. Forces the patch removal even if the patch was superseded by another patch.
-G. Removes the patch from the packages in the current zone only.
-B . Specifics the backout directory for a patch to be removed so that the saved files could be restored.

Comments