SUMMARY: How do you eliminate an old patch reference?

From: Jeffery Small (jeff@cjsa.cjsa.com)
Date: Thu Jun 19 1997 - 10:59:35 CDT


The original question:
------------------------------------------------------------------------------
I just upgraded to "Solaris 2.5.1 Hardware: 4/97" which installed
a number of patches. I then went to patch the system with some more
recent versions of these patches. I am unable to back-out the
previous patches since they were automatically installed without the
save option. When I install the new patches, "showrev -p" reports
both patches as being installed (e.g. 103582-08 and 103582-10).
 
What is the procedure required to eliminate all references to the
older patch? Where are the patch records recorded?
 
(I tried removing the /var/sadm/patch/######-## directory but this
had no apparent effect.)
 
Thanks for any help you can offer. I will summarize the results.
------------------------------------------------------------------------------

This question was asked an answered a year ago by Dr Peter Watkins.
I include the important excerpts from his previous summary below.
I also received helpful suggestions from Sean Ward and Christian Masopust.

In a nutshell, to eliminate references to these patches which cannot
be backed out you must:

        1: Edit out all references to the undesired patch from the
           pkginfo files in the /var/adm/pkg/* directories. Locate
           these references by:
                                   cd /var/adm/pkg
                                grep <patch-id> */pkginfo

        2: Remove the directory /var/sadm/patch/<patch-id>.

Thanks to everyone who responded, including those of you whose messages
have not yet arrived.

--
Jeff Small                 C. Jeffery Small & Associates    (206) 232-3338
jeff@cjsa.com              7000 E Mercer Way,  Mercer Island, WA     98040

------------------------------------------------------------------------------ The following is a portion of Dr. Peter Watkins' summary from July 1966:

PROBLEM: 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? SOLUTION 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; mail= instance=unique partial=nocheck runlevel=nocheck idepend=quit rdepend=quit space=quit setuid=nocheck conflict=nocheck action=nocheck basedir=default 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; ftp.fwi.uva.nl:/pub/solaris/auto-install the Perl script rm-patchdata.pl (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 fastpatch.pl and do-patch that do similar things and are in the same directory. Thanks to; Casper Dik <casper@holland.Sun.COM> "Coffindaffer, Virginia" <C80005LQ@wangfed.com>



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