Monday, September 8, 2008

HPUX How to check if patch have been installed and install the patch

let say we want to check for this patch
phkl_36745 and phne_37489

# swlist -l patch | grep -i phkl_36745
PHKL_36745.LVM-KRN 1.0 LVM.LVM-KRN applied
PHKL_36745.CORE2-KRN 1.0 OS-Core.CORE2-KRN applied
# PHKL_36745 1.0 LVM Cumulative Patch
# PHKL_36745.CORE2-KRN 1.0 OS-Core.CORE2-KRN applied
# PHKL_36745.LVM-KRN 1.0 LVM.LVM-KRN applied
# swlist -l patch | grep -i phne_37489

This shows that patch phkl_36745 is installed and phne_37489 is not installed yet

1. Back up your system before installing a patch.

2. Login as root.

3. Download and Copy the patch to the /tmp directory.

4. Move to the /tmp directory and unshar the patch:

cd /tmp
sh PHNE_37489

5. Run swinstall to install the patch:

swinstall -x autoreboot=true -x patch_match_target=true \
-s /tmp/PHNE_37489.depot

By default swinstall will archive the original software in
/var/adm/sw/save/PHNE_37489. If you do not wish to retain a
copy of the original software, include the patch_save_files
option in the swinstall command above:

-x patch_save_files=false

WARNING: If patch_save_files is false when a patch is installed,
the patch cannot be deinstalled. Please be careful
when using this feature.

For future reference, the contents of the PHNE_37489.text file is
available in the product readme:

swlist -l product -a readme -d @ /tmp/PHNE_37489.depot

To put this patch on a magnetic tape and install from the
tape drive, use the command:

dd if=/tmp/PHNE_37489.depot of=/dev/rmt/0m bs=2k