1patchrm(1M)             System Administration Commands             patchrm(1M)
2
3
4

NAME

6       patchrm  -  remove a Solaris patch package and restore previously saved
7       files
8

SYNOPSIS

10       patchrm [-f] [-G] [-B backout_dir]
11            [-C net_install_image | -R client_root_path | -S service]
12            [-t] patch_id
13
14

DESCRIPTION

16       patchrm removes a patch package and restores previously saved files  to
17       a system running the Solaris 2.x operating environment or later Solaris
18       environments (such as Solaris 8) that are compatible with Solaris  2.x.
19       patchrm  cannot  be used with Solaris 1 patches. patchrm must be run as
20       root.
21
22
23       With respect to zones(5), when invoked in the global zone, by  default,
24       patchrm  patches  all  appropriate packages in all zones. Patch removal
25       behavior in a zones environment varies according to the following  fac‐
26       tors:
27
28           o      use of the -G option (described below)
29
30           o      setting  of  the  SUNW_PKG_ALLZONES  variable in the pkginfo
31                  file (see pkginfo(4)).
32
33           o      type of zone, global or local (non-global) in patchrm  which
34                  is invoked
35
36
37       The interaction of the factors above is specified in "Interaction of -G
38       and pkginfo Variable in Zones," below.
39
40
41       When you remove patches from packages on a Solaris  system  with  zones
42       installed,  you will see numerous zones-related messages, the frequency
43       and content of which depend on whether you invoke patchrm in  a  global
44       or  local zone, the setting of SUNW_PKG_ALLZONES, and the use of the -G
45       option.
46

OPTIONS

48       The following options are supported:
49
50       -B backout_dir
51
52           Removes a patch whose backout data has been saved  to  a  directory
53           other  than the package database. This option is only needed if the
54           original backout directory, supplied to  the  patchadd  command  at
55           installation  time, has been moved. Specify backout_dir as an abso‐
56           lute path name.
57
58
59       -C net_install_image
60
61           Removes the patched files located on the mini root on a Net Install
62           Image created by setup_install_server. Specify net_install_image as
63           the absolute path name to a Solaris 2.6 or compatible version  boot
64           directory. See EXAMPLES.
65
66
67       -f
68
69           Forces the patch removal regardless of whether the patch was super‐
70           seded by another patch.
71
72
73       -G
74
75           Remove patch(es) to packages in the current zone only. When used in
76           the  global  zone, the patch is removed from packages in the global
77           zone only and is not removed from packages  in  any  existing  non-
78           global  zone.  When used in a non-global zone, the patch is removed
79           from packages in the non-global zone only. See "Interaction  of  -G
80           and pkginfo Variable in Zones,", below.
81
82
83       -R client_root_path
84
85           Locates  all  patch  files generated by patchrm under the directory
86           client_root_path. client_root_path is the directory  that  contains
87           the  bootable root of a client from the server's perspective. Spec‐
88           ify client_root_path as the absolute path name to the beginning  of
89           the  directory  tree  under  which  all  patch files generated from
90           patchrm will be located. -R cannot be specified with the -S option.
91
92           Note -
93
94             The root file system of any non-global zones must not  be  refer‐
95             enced with the -R option. Doing so might damage the global zone's
96             file system, might compromise the security of  the  global  zone,
97             and might damage the non-global zone's file system. See zones(5).
98
99
100       -S service
101
102           Specifies  an  alternate  service  (for example, Solaris_2.3). This
103           service is part of the server and client model,  and  can  only  be
104           used  from  the  server's  console. Servers can contain shared /usr
105           file systems that are created  by  smosservice(1M).  These  service
106           areas can then be made available to the clients they serve. -S can‐
107           not be specified with the -R option.
108
109
110       -t
111
112           Maintains the patchrm return codes from the Solaris  release  prior
113           to  Solaris 10. On a system with  zones(5) installed, a return code
114           of 0 indicates success. Any other return code indicates failure.
115
116
117   Interaction of -G and pkginfo Variable in Zones
118       The following list specifies the interaction between the -G option  and
119       the  SUNW_PKG_ALLZONES  variable (see pkginfo(4)) when removing a patch
120       in global and local (non-global) zones.
121
122       global zone, -G specified
123
124           If any packages have SUNW_PKG_ALLZONES set to true: Error;  nothing
125           changes.
126
127           If  no  packages  have  SUNW_PKG_ALLZONES set to true: Remove patch
128           from package(s) in global zone only.
129
130
131       global zone, -G not specified
132
133           If any packages have SUNW_PKG_ALLZONES set to  true:  Remove  patch
134           from appropriate package(s) in all zones.
135
136           If  no  packages  have  SUNW_PKG_ALLZONES set to true: Remove patch
137           from appropriate package(s) in all zones.
138
139
140       local zone, -G specified or not specified
141
142           If any packages have SUNW_PKG_ALLZONES set to true: Error;  nothing
143           changes.
144
145           If  no  packages  have  SUNW_PKG_ALLZONES set to true: Remove patch
146           from package(s) in local zone only.
147
148

OPERANDS

150       The following operands are supported:
151
152       patch_id
153
154           The patch number of a given patch. 104945-02 is  an  example  of  a
155           patch_id.
156
157

EXAMPLES

159       The  examples  in  this  section  assume  that patch 104945-02 has been
160       installed to the system prior to removal. All of the examples are rela‐
161       tive to the /usr/sbin directory.
162
163       Example 1 Removing a Patch From a Stand-alone System
164
165
166       The following example removes a patch from a standalone system:
167
168
169         example# patchrm 104945-02
170
171
172
173       Example  2  Removing  a  Patch From a Client's System From the Server's
174       Console
175
176
177       The following example removes a patch from a client's system  from  the
178       server's console:
179
180
181         example# patchrm -R /export/root/client1 104945-02
182
183
184
185
186       Note  the caveat on the use of the -R option in the description of that
187       option, above.
188
189
190       Example 3 Removing a Patch From a Server's Service Area
191
192
193       The following example removes a patch from a server's service area:
194
195
196         example# patchrm -S Solaris_2.3 104945-02
197
198
199
200       Example 4 Removing a Patch From a Net Install Image
201
202
203       The following example removes a patch from a Net Install Image:
204
205
206         example# patchrm -C /export/Solaris_2.6/Tools/Boot 104945-02
207
208
209

EXIT STATUS

211       The following exit values are returned:
212
213       0
214
215           Successful completion.
216
217
218       >0
219
220           An error occurred.
221
222

ATTRIBUTES

224       See attributes(5) for descriptions of the following attributes:
225
226
227
228
229       ┌─────────────────────────────┬─────────────────────────────┐
230       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
231       ├─────────────────────────────┼─────────────────────────────┤
232       │Availability                 │SUNWswmt, SUNWcsu            │
233       └─────────────────────────────┴─────────────────────────────┘
234

DIAGNOSTICS

236       The following messages may help in determining some of the most  common
237       problems associated with backing out a patch.
238
239       Message
240
241
242             prebackout patch exited with return code code.
243             patchrm exiting.
244
245
246
247           Explanation and Recommended Action
248
249               The  prebackout  script  supplied  with the patch exited with a
250               return code other than 0. Generate a script trace of  the  pre‐
251               backout  script  to determine why the prebackout script failed.
252               Add the -x option to the first line of the prepatch  script  to
253               fix the problem and run patchadd again.
254
255
256
257       Message
258
259
260             postbackout patch exited with return code code.
261             patchrm exiting.
262
263
264
265           Explanation and Recommended Action
266
267               The  postbackout  script  supplied with the patch exited with a
268               return code other than 0. Look at  the  postbackout  script  to
269               determine why it failed. Add the -x option to the first line of
270               the prepatch script to fix the problem, and, if necessary,  re-
271               exececute the postbackout script only.
272
273
274
275       Message
276
277
278             Only one service may be defined.
279
280
281
282           Explanation and Recommended Action
283
284               You  have attempted to specify more than one service from which
285               to backout a patch. Different services must have their  patches
286               backed out with different invocations of patchrm.
287
288
289
290       Message
291
292
293             The -S and -R arguments are mutually exclusive.
294
295
296
297           Explanation and Recommended Action
298
299               You   have   specified   both   a   non-native  service  and  a
300               client_root_path from which to backout a patch. These two argu‐
301               ments  are  mutually  exclusive.  If backing out a patch from a
302               non-native usr partition, the -S  option  should  be  used.  If
303               backing  out  a  patch  from  a client's root partition (either
304               native or non-native), the -R option should be used.
305
306
307
308       Message
309
310
311             The service service cannot be found on this system
312
313
314
315           Explanation and Recommended Action
316
317               You have specified a non-native service from which to backout a
318               patch,  but the specified service is not installed on your sys‐
319               tem. Correctly specify the service when backing out the patch.
320
321
322
323       Message
324
325
326             Only one client_root_path may be defined.
327
328
329
330           Explanation and Recommended Action
331
332               You have specified more than one client_root_path using the  -R
333               option.  The  -R option may be used only once per invocation of
334               patchrm.
335
336
337
338       Message
339
340
341             The dir directory cannot be found on this system.
342
343
344
345           Explanation and Recommended Action
346
347               You have specified a directory using the  -R  option  which  is
348               either  not  mounted,  or does not exist on your system. Verify
349               the directory name and re-backout the patch.
350
351
352
353       Message
354
355
356             Patch patch_id has not been successfully installed to this system.
357
358
359
360
361           Explanation and Recommended Action
362
363               You have attempted to backout a patch that is not installed  on
364               this  system.  If you must restore previous versions of patched
365               files, you may have to restore the original files from the ini‐
366               tial installation CD.
367
368
369
370       Message
371
372
373             Patch patch_id has not been successfully applied to this system.
374             Will remove directory dir.
375
376
377
378           Explanation and Recommended Action
379
380               You  have  attempted to back out a patch that is not applied to
381               this system. While the patch has not been applied,  a  residual
382               /var/sadm/patch/patch_id    (perhaps   from   an   unsuccessful
383               patchadd) directory still exists. The patch  cannot  be  backed
384               out. If you must restore old versions of the patched files, you
385               may have to restore them from the initial installation CD.
386
387
388
389       Message
390
391
392             This patch was obsoleted by patch patch_id.
393             Patches must be backed out in the reverse order in
394             which they were installed. Patch backout aborted.
395
396
397
398           Explanation and Recommended Action
399
400               You are attempting to backout patches  out  of  order.  Patches
401               should  never  be backed-out out of sequence. This could under‐
402               mine the integrity of the more current patch.
403
404
405
406       Message
407
408
409             Patch patch_id is required to be installed by an already
410             installed patch_id.
411             It cannot be backed out until the required patch is backed out first.
412
413
414
415           Explanation and Recommended Action
416
417               Backout the patch that is required to be installed then backout
418               the desired patch.
419
420
421
422       Message
423
424
425             The installation of patch patch_id was interrupted.
426
427
428
429           Explanation and Recommended Action
430
431               A  previous installation was interrupted. The interrupted patch
432               needs to be installed before backing out the desired patch.
433
434
435
436       Message
437
438
439             Patch patch_id was installed without backing up the original
440             files. It cannot be backed out.
441
442
443
444           Explanation and Recommended Action
445
446               Either the -d option of patchadd was set  when  the  patch  was
447               applied,  or  the  save area of the patch was deleted to regain
448               space. As a result,  the  original  files  are  not  saved  and
449               patchrm  cannot  be used. The original files can only be recov‐
450               ered from the original installation CD.
451
452
453
454       Message
455
456
457             pkgadd of pkgname package failed return code code.
458             See /var/sadm/patch/patch_id/log for reason for failure.
459
460
461
462           Explanation and Recommended Action
463
464               The installation of one of patch packages failed. See  the  log
465               file  for  the  reason for failure. Correct the problem and run
466               the backout script again.
467
468
469
470       Message
471
472
473             Restore of old files failed.
474
475
476
477           Explanation and Recommended Action
478
479               The backout script uses the cpio command to restore the  previ‐
480               ous  versions of the files that were patched. The output of the
481               cpio command should have preceded this message. The user should
482               take  the  appropriate action to correct the cpio failure. This
483               is for Solaris 2.4 or previous versions.
484
485
486

SEE ALSO

488       cpio(1), pkginfo(1), patchadd(1M), pkgadd(1M),  pkgchk(1M),  pkgrm(1M),
489       showrev(1M), pkginfo(4), attributes(5), zones(5)
490

NOTES

492       On  client server machines the patch package is not removed from exist‐
493       ing clients or from client root template space. Therefore, when  appro‐
494       priate,  all client machines will need the patch removed directly using
495       this same patchrm method on the client. A bug affecting a package util‐
496       ity  (for  example, pkgadd, pkgrm, pkgchk) could affect the reliability
497       of patchadd or patchrm which use package utilities to install and back‐
498       out  the  patch  package.  It  is recommended that any patch that fixes
499       package utility problems be reviewed and, if necessary, applied  before
500       other patches are applied. Existing patches are:
501
502       Solaris 2.1:
503
504           patch 100901
505
506
507       Solaris 2.2:
508
509           101122
510
511
512       Solaris 2.3:
513
514           10133
515
516
517       Solaris 2.4 Sparc Platform Edition:
518
519           102039
520
521
522       Solaris 2.4 Intel Platform Edition:
523
524           102041
525
526
527       Solaris 2.5.1 Sparc Platform Edition:
528
529           104578
530
531
532       Solaris 2.51 Intel Platform Edition:
533
534           104579
535
536
537       Solaris 2.6 Sparc Platform Edition:
538
539           106292
540
541
542       Solaris 2.6 Intel Platform Edition:
543
544           106293
545
546

WARNINGS

548       Certain  patches are classified as "deferred activation" patches (some‐
549       times with initial capitals, as "Deferred Activation"  patches).  Under
550       conditions  indicated below, such patches require special treatment.  A
551       patch's README file specifies whether that patch  is  of  the  deferred
552       activation  variety.  (Search  on  "Deferred  Activation" in the README
553       file.)
554
555
556       If you are installing or removing a patch that uses deferred activation
557       patching, you must check on the following:
558
559           o      On a system running zones, all non-global zones must be in a
560                  halted state for adding or removing a patch.
561
562           o      Deferred activation patching requires the loopback file sys‐
563                  tem  (lofs) in order to complete safely. Systems running Sun
564                  Cluster 3.1 or Sun Cluster  3.2  are  likely  to  have  lofs
565                  turned  off  because of restrictions on HA-NFS functionality
566                  when lofs is enabled. Therefore, before a  deferred  activa‐
567                  tion  patch  is installed or removed, you must re-enable the
568                  loopback file system by commenting out the following line in
569                  the /etc/system file:
570
571                    exclude:lofs
572
573
574                  Then,  reboot  your  system and install or remove the patch.
575                  After you have completed the patch operation, uncomment  the
576                  line cited above, then reboot to resume normal operation.
577
578
579
580SunOS 5.11                        20 Jun 2007                      patchrm(1M)
Impressum