SolarisApplyPatches

Applying patches to an existing Solaris installation

Please note : this applies to Solaris 10, but the procedure should be almost the same for Solaris 8 and 9. Don't forget to check man patchadd for more information.

Download the patches

Most patches for Solaris 8, 9 and 10 can be downloaded from the Sunsolve page. You need an account to consult the patches list, but opening one is free and easy.

WARNING: Do not use any downloader, such as Down Them All under Firefox, or the download will fail miserably!

Once the patches have been downloaded, usually in zip format, transfer them to the machine to be patched... Yeah, I know, fairly obvious, but sometimes things need to be said... :-)

Installing the patches

All patches are installed through the command patchadd. Before you do anythin else, checking the man page for patchadd would be a good idea.

1. Installing the easy way

Installing patches is easy, but, for some reason, the must be moved to the /var/sadm/spool/ directory before they can be installed.

The correct procedure is therefore:

# unzip <patch_number>
# mv -R ./<patch_number> /var/sadm/spool/
# patchadd /var/sadm/spool/<patch_number>

Since the best example is to see it done:

bash-3.00# cp -R ./120760-21/ /var/sadm/spool/

bash-3.00# patchadd /var/sadm/spool/120760-21/
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

Checking patches that you specified for installation.

Done!


Approved patches will be installed in this order:

120760-21


Checking installed patches...
Verifying sufficient filesystem capacity (dry run method)...
Installing patch packages...

Patch 120760-21 has been successfully installed.
See /var/sadm/patch/120760-21/log for details

Patch packages installed:
  SPROlang
  SPROlangx

Here is an example of a failed installation, just to compare :

bash-3.00# patchadd -M /export/home/teamsys/patches/120760-21/
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Cannot open pkginfo file /export/home/teamsys/patches/120760-21/SPROlang/reloc/pkginfo
Cannot open pkginfo file /export/home/teamsys/patches/120760-21/SPROlang/install/pkginfo
Cannot open pkginfo file /export/home/teamsys/patches/120760-21/SPROlangx/reloc/pkginfo
Cannot open pkginfo file /export/home/teamsys/patches/120760-21/SPROlangx/install/pkginfo
Done!

The following requested patches do not update any packages installed on the system
Packages from patch SPROlang are not installed on the system.
Packages from patch SPROlangx are not installed on the system.

No patches to check dependency.

Installing from /var/sadm/spool/ is therefore considered mandatory, unless someone has a better solution (drop me a line!).

2. One-liner for patch installation

This requires a zip_files sub-directory to be created in the directory where you store your patches ZIP files.

It can be quite handy if -- like me -- you have quite a lot of patches to install in one go, from the same directory.

Here it is:

bash-3.00# unzip 122142-03.zip && \
           mv 122142-03.zip ./zip_files/  && \
           cp -R ./122142-03/ /var/sadm/spool/ && \
           patchadd /var/sadm/spool/122142-03/
Archive:  122142-03.zip
   creating: 122142-03/
  inflating: 122142-03/.diPatch
  inflating: 122142-03/patchinfo
   creating: 122142-03/SPROdbxui/
  inflating: 122142-03/SPROdbxui/pkgmap
  inflating: 122142-03/SPROdbxui/pkginfo
   creating: 122142-03/SPROdbxui/reloc/
   creating: 122142-03/SPROdbxui/reloc/SUNWspro/
   creating: 122142-03/SPROdbxui/reloc/SUNWspro/prod/
   creating: 122142-03/SPROdbxui/reloc/SUNWspro/prod/modules/
  inflating: 122142-03/SPROdbxui/reloc/SUNWspro/prod/modules/dbxGUI.jar
   creating: 122142-03/SPROdbxui/install/
  inflating: 122142-03/SPROdbxui/install/checkinstall
  inflating: 122142-03/SPROdbxui/install/copyright
  inflating: 122142-03/SPROdbxui/install/i.none
  inflating: 122142-03/SPROdbxui/install/patch_checkinstall
  inflating: 122142-03/SPROdbxui/install/patch_postinstall
  inflating: 122142-03/SPROdbxui/install/postinstall
  inflating: 122142-03/SPROdbxui/install/preinstall
   creating: 122142-03/SUNWnbcpp/
  inflating: 122142-03/SUNWnbcpp/pkgmap
  inflating: 122142-03/SUNWnbcpp/pkginfo
   creating: 122142-03/SUNWnbcpp/install/
  inflating: 122142-03/SUNWnbcpp/install/checkinstall
  inflating: 122142-03/SUNWnbcpp/install/copyright
  inflating: 122142-03/SUNWnbcpp/install/i.none
  inflating: 122142-03/SUNWnbcpp/install/patch_checkinstall
  inflating: 122142-03/SUNWnbcpp/install/patch_postinstall
  inflating: 122142-03/SUNWnbcpp/install/postinstall
  inflating: 122142-03/SUNWnbcpp/install/preinstall
   creating: 122142-03/SUNWnbcpp/reloc/
   creating: 122142-03/SUNWnbcpp/reloc/netbeans/
   creating: 122142-03/SUNWnbcpp/reloc/netbeans/3.5V11/
   creating: 122142-03/SUNWnbcpp/reloc/netbeans/3.5V11/modules/
  inflating: 122142-03/SUNWnbcpp/reloc/netbeans/3.5V11/modules/cpp.jar
   creating: 122142-03/SPROidext/
   creating: 122142-03/SPROidext/reloc/
   creating: 122142-03/SPROidext/reloc/SUNWspro/
   creating: 122142-03/SPROidext/reloc/SUNWspro/prod/
   creating: 122142-03/SPROidext/reloc/SUNWspro/prod/scripts/
  inflating: 122142-03/SPROidext/reloc/SUNWspro/prod/scripts/jdk_chooser
  inflating: 122142-03/SPROidext/reloc/SUNWspro/prod/scripts/jdk_compare
   creating: 122142-03/SPROidext/install/
  inflating: 122142-03/SPROidext/install/checkinstall
  inflating: 122142-03/SPROidext/install/copyright
  inflating: 122142-03/SPROidext/install/i.none
  inflating: 122142-03/SPROidext/install/patch_checkinstall
  inflating: 122142-03/SPROidext/install/patch_postinstall
  inflating: 122142-03/SPROidext/install/postinstall
  inflating: 122142-03/SPROidext/install/preinstall
  inflating: 122142-03/README.122142-03
  inflating: 122142-03/LEGAL_LICENSE.TXT
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

Checking patches that you specified for installation.

Done!


Approved patches will be installed in this order:

122142-03


Checking installed patches...
Verifying sufficient filesystem capacity (dry run method)...
Installing patch packages...

Patch 122142-03 has been successfully installed.
See /var/sadm/patch/122142-03/log for details

Patch packages installed:
  SPROdbxui
  SPROidext
  SUNWnbcpp

Please note that the one-liner has been broken down into several lines above, to make it fit in this wiki.

All these commands on one line allow you to:

  1. Unzip the patch file.
  2. Move the zip file to the sub-directory to keep a copy.
  3. Copy the patch directory into /var/sadm/spool.
  4. Install the patch automatically on the server.

This can speed patch installation quite a bit.

Hope this helps!