Here are examples for administering packages and patches in SOLARIS10 OS, mostly copied from http://sol10pkgmgmt.blogspot.ca/, I googled a bit before I started from scratch, I think the article is very clear, so I just reorganized a little bit.
Managing software in SOL10 contains 2 activities :
- management of packages (software)
- management of patches (updates to software)
In Unix world software that we actually install on a system in called package. In SOL10 we have 2 types of packages :
- file system format
- data stream format
Checking installed packages :
# pkgchk SUNWladm
# pkgchk -v SUNWladm
# pkgchk -l -p /usr/bin/showrev
# pkgchk -l -P passwd
# pkgchk -p /etc/shadow ---> to determine if content and attributes of file has changed
Listing and displaying info about packages installed and spooled.
# pkginfo -l | more
# pkginfo -d /var/spool/pkg -l SUNWman
# pkginfo -d /cdrom/cdrom0/Solaris_10/Product SUNWman
# pkginfo -d spool SUNWdoc
Installing and spooling new packages
# pkgadd -d /cdrom/cdrom0/Solaris_10/Product SUNWman
# pkgadd ./SUNWman
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s spool SUNWauda
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s /export/pkg SUNWauda
# pkgrm SUNWman
# pkgrm -s spool SUNWman
# pkgrm -s /export/pkg SUNWman
Dispalying content of data stream packages.
# head SUNWman.pkg | more
Checking package file type.
# file SUNWman.pkg
Transforming package from file system format to data stream format.
# pkgtrans -s /cdrom/cdrom0/s0/Solaris_10/Product /var/tmp/stream.pkg SUNWzlib SUNWftpr SUNWftpu
# pkgtrans /var/tmp /tmp/SUNWrsc.pkg SUNWrsc
# pkgadd -d /var/tmp/stream.pkg
Package Administration Files and Directories
|Files and Directories||Description file|
|/var/sadm/install/contents||A software package map of the entire system|
|/opt/pkgname||The preferred location for the installation of unbundled packages|
| /opt/pkgname/bin or
|The preferred location for the executable files of unbundled packages|
| /var/opt/pkgname or
|The preferred location for log files of unbundled packages|
A patch contains a collection of files and directories. This collection replaces existing files and directories that prevent proper execution of the software. Some patches contain product enhancements.
The Solaris OS patch types include:
Standard patches - Patches that fix specific problems with the Solaris OS and other Sun hardware and software products.
Recommended patches - Solaris OS patches that fix problems that might occur on a large percentage of systems. These include recommended security patches.
Firmware and PROM patches.
Patch clusters - A group of standard, recommended, security, or Y2K patches that have been bundled into a single archive for easy downloading and installation.
A patch is distributed as a directory that is identified by a unique number. The number assigned to a patch includes the patch base code first, a hyphen, and a number that represents the patch revision number. For example, a patch directory named 105050-01, indicates that 105050 is the patch number and 01 is the revision number.
Not all patches available from Sun Microsystems must be installed. Care should be taken to study the README documents for each patch, and then decide on each patch before it is applied to a system.
Display already installed patches
# showrev -p
or another cmd
# patchadd -p
Command output is the same for the patchadd -p and showrev -p commands; however, the patchadd command takes longer to display patch information. The showrev command is a binary, and the patchadd command is a script.
Deleting files from the /var/sadm directory to make more space is a Solution Center call generator. The only way to correct the problems that occur is to restore the deleted files from backup tapes or to reload the Solaris OS.
It is important to ensure that sufficient space has been allocated for the /var file system. There must be sufficient space for the /var/sadm directory to grow as new software packages and patches are installed on the system.
When patches are downloaded to the local system, you must place the patches in a temporary directory to prepare them for installation. The directory commonly used is the /var/tmp directory.
One of the common reasons for patch installation failure is directory permission or ownership problems. The /var/tmp directory is open to all and eliminates any of these types of problems.
The Solaris 7, Solaris 8, Solaris 9, and Solaris 10 OS patches are in zip format, for example, 105050-01.zip.
Use the unzip command to unpack the patch files.
# /usr/bin/unzip 105050-01.zip
# patchadd 105050-01
Patches can be added using the -d (nosave) option to save space. When this option is used, patchadd does not save copies of the files being updated or replaced, and therefore cannot be backed out.
When you remove a patch, the patchrm command restores all files that were modified or replaced by that patch, unless:
The patch was installed with the patchadd -d option (which instructs the patchadd command not to save copies of files being updated or replaced)
The patch is required by another patch
The patch has been obsoleted by a later patch
The patchrm command calls the pkgadd utility to restore packages that were saved during the initial patch installation.
To install a patch cluster, perform the following steps:
Be sure the patch cluster has been unzipped or uncompressed and extracted if the cluster was received as a tar.Z file.
Decide on which method to use to install the cluster--the recommended default save option or the -nosave option.
Change to the directory that contains the patch cluster. Read the CLUSTER_README file, which contains information about the bundled set of patches, including:
Cluster description Patches included Important notes and warnings Save and backout options Special install instructions Special patch circumstances Any notices and other recommendations
Then run the install_cluster script
# cd 10_Recommended
The installation appears as follows:
Patch cluster install script for Solaris 10 Recommended
*WARNING* SYSTEMS WITH LIMITED DISK SPACE SHOULD *NOT* INSTALL PATCHES:
(Other disk space warning messages omitted.)
Are you ready to continue with install? [y/n]:y
Determining if sufficient save space exists...
Sufficient save space exists, continuing...
Installing patches located in /tmp/10_Recommended
Using patch_order file for patch installation sequence
(Other patch messages omitted.)
The following patches were not able to be installed:
For more installation messages refer to the installation logfile:
Use '/usr/bin/showrev -p' to verify installed patch-ids.
Refer to individual patch README files for more patch detail.
Rebooting the system is usually necessary after installation
Read each individual patch README file to determine if any additional steps are required to fully install any individual patch.
Check the log file if more detail is needed.
Reviewing the log provides information about why the patches listed above were not able to be installed:
# more /var/sadm/install_data/Solaris_10_Recommended_log
*** Install Solaris 10 Recommended begins Mon Oct 18 14:47:11 BST 2004***
*** PATCHDIR = /tmp/10_Recommended ***
Checking installed patches...
Patch 112875-01 has already been applied.
See patchadd(1M) for instructions.
Checking installed patches...
One or more patch packages included in
113023-01 are not installed on this system.
Reboot the system for all patches to take effect.