SUMMARY: backing out of sun patches

From: Peter Watkins (
Date: Wed Jun 12 1996 - 02:54:51 CDT

My original question can be found at the end of this email but
the basic problem and it's solution are summarised below.

  When installing patches to a Solaris 2.x system it is usual
  to back out of the old patch revision, or obsoleted patches,
  and then install the new patch. Usually this is done via the
  generic 'installpatch' and 'backoutpatch' commands. In some
  cases old patches cannot be backed out of because the earlier
  patch revision was not saved. New versions of the patches can
  then installed without problems but the patch revision data
  as shown by 'showrev -p' still indicates the presence of the
  earlier, obsolete patches. So the question is how to correct
  the patch revision database in this situation?

  Patches under Solaris 2.x are installed as 'packages' using
  the pkgadd, pkprm, etc commands with administrative files and
  databases of installed packages. I had no time to investigate
  this fully but Casper Dik provided a perl script(s) which did
  the job. Basically to remove patch 100000-01 you need to do
  two things;

     1) pkgrm -a <admin_file> -n 100000-01
     2) rm -rf /var/sadm/patch/100000-01

  the <admin_file> looks like;


  Casper Dik pointed me at several Perl scripts that he, and
  others, had written to do this. Have a look at ALL the stuff
  in the directory;

  the Perl script (in update.tar.gz) did the
  job for me. Using Perl 5.001 I had to modify the script on
  one line to get it to work viz;

     if (!&Getopts('fr')) {

  goes to

     if (!&Getopts(':fr')) {

  This script checks the installed patch database, finds the
  patches obsoleted by newer installed revisions and removes
  obsoleted patch records if told to (creating <admin_file>
  and running pkgrm & rm -rf automatically). Specifying the
  patch name on the command line seems to have no effect.

  You may also want to look at and do-patch that
  do similar things and are in the same directory.

Thanks to;
 Casper Dik <casper@holland.Sun.COM>
 "Coffindaffer, Virginia" <>

Original question;
> Dear All,
> This must be a situation that many people are in but I cannot find
> a straightforward solution. Can anyone help?
> I have a Solaris 2.4 system with a lot of patches installed, including
> many from the original Solaris 2.4 CD-ROM. These were added without the
> "save" feature - the default for the CD-ROM patches.
> Many of these patches are now ancient and I am updating them. Prior to
> doing this I try "backoutpatch" from the existing patch dir in
> /var/sadm/patch but this fails because of the nosave option. The new
> patch installs fine but "showrev -p" still indicates the old patch to
> be installed. This info is now VERY misleading and I really need to
> get the patch info tables up to date.
> I have tried "backoutpatch -f" but that doesn't seem to work either!
> Just says that I haven't saved the patch.
> What I need is a script, or recipe, to adjust /var/sadm/install/contents
> and /var/sadm/patch/<patchid> to reflect the REAL situation. Does anyone
> have such a thing?

Dr Peter Watkins.
| Joint Research Centre, | |
| Institute of Advanced Materials, | Tel: (+31)-224-565120 |
| Commission of the European Communities, | Fax: (+31)-224-561449 |
| P.O. Box 2, | Email: |
| 1755 ZG Petten, | http: ??? |
| The Netherlands. | |

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:01 CDT