5-7章 sa239学习笔记之四安装软件部分( 三 )



显示patch安装的目录:
# ls /var/sadm/patch
所以/var必须为安装补丁预留充分的空间;

获取补丁的方法:
用户可向SUN索取update CDrom,或到网站下载;
-------------------------------------------------------------------------------------------
提示:mget获取文件时每个文件都会提醒,如果不想可以用ftp -i FTPweb,或者在FTP登录后输入prompt命令;
--------------------------------------------------------------------------------------------

准备安装:
.ZIP文件: # /usr/bin/unzip 105050-01.zip
.tar.z文件:# /usr/bin/zcat 105050-01.tar.Z | tar xvf -

安装:
# patchadd 105050-01

存储在/usr/sbin/patchadd下的error code:
0 No error.
1 Usage error.
2 An attempt to apply a patch that has already been
applied.
3 The effective user ID (EUID) is not root.
4 An attempt to save original files failed.
5 The pkgadd command failed.
6 The patch is obsolete.
7 An invalid package directory.
8 An attempt to patch a package that is not installed.
9 Cannot access /usr/sbin/pkgadd (client problem).
10 Package validation errors.
11 An error occurred while adding a patch to the root
template.
12 The patch script terminated due to a signal.
13 A symbolic link was included in the patch.
14 Not used.
15 The prepatch script had a return code other than 0.
16 The postpatch script had a return code other than 0.
17 A mismatch of the -d option occurred between a
previous patch installation and the current one.
18 There is not enough space in the file systems that are
targets of the patch.
19 The $SOFTINFO/INST_RELEASE file was not found.
20 A direct instance patch was required but was not
found.
21 The required patches have not been installed on the
manager.
22 A progressive instance patch was required but was not
found.
23 A restricted patch is already applied to the package.
24 An incompatible patch was applied.
25 A required patch was not applied.
26 The user-specified backout data cannot be found.
27 The relative directory supplied cannot be found.
28 A pkginfo file is corrupt or missing.
29 Bad patch ID format.
30 Dry run failures occurred.
31 The path given for the -C option was invalid.
32 You must be running the Solaris 2.6 OE to the Solaris 9
OE.
33 The patch file was formatted incorrectly or the patch
file was not found.
34 An incorrect patch spool directory was given.
35 A later revision was already installed.
36 You cannot create a safe temporary directory.
37 An illegal backout directory was specified.


删除补丁patchrm:
如下三种情况无法正常删除补丁:

1.在安装补丁时用了-d参数:patchadd -d 即更新不进行备份;
2.此补丁被其它补丁使用;
3.补丁已经被更新的补丁替代;

# patchrm 105050-01


安装patch cluster:

patch cluster由推荐补丁,安全补丁以及Y2K patch组成;安装时必须在/ /var /usr /opt有至少10M的空间,会把patch存在/var/sadm/pkg目录,也可-nosave,将不能对个别patch进行恢复删除,


具体步骤如下:
1.确定.zip 或.tar.z文件已经解压;
2.决定使用默认的save还是-nosave属性;
3.到解压后的patch cluster目录,进行安装
# cd patch_cluster_directory
# ./install_cluster
4.查看个别的patch的README文件,看是否还要进行附加的步骤;
5.查看日志文件,查看详细信息;
6.重启机器,使patch 生效;

推荐阅读