全部博文(245)
分类: LINUX
2008-05-31 11:08:55
| 1.检查软件包的依赖(Dependency) |
| 2.检查软件包的冲突(Conflicts) |
| 3.执行安装前脚本程序(Preinstall) |
| 4.处理配置文件(Configfiles) |
| 5.解压软件包并存放到相应位置 |
| 6.执行安装后脚本程序(Postinstall) |
| 7.更新RPM数据库 |
| 8.执行安装时触发脚本程序(Triggerin) |
| rpm -i [安装选项1 安装选项2...] 包裹文件1 包裹文件2... |
| 1.典型的命名样式(常用): |
| 格式为:软件名-版本号-释出号.体系号.rpm |
| 2.URL形式的命名样式(较常用): |
| * FTP方式的命名格式:ftp://[用户名[:密码]@]主机[:端口]/包裹文件 |
| 如ftp://ftp.xxx.com/yyy.rpm(使用匿名传输,主机ftp.xxx.com,包裹文件yyy.rpm); 如ftp://24.109.164.55:1024/pub/yyy.rpm(匿名FTP传输,主机IP:24.109.164.55,使用1024端口,包裹文件在/pub目录下); 如ftp://zhsoft@ftp.xxx.com/yyy.rpm(主机ftp.xxx.com,FTP用户名zhsoft,如有密码,RPM将会自动提示输入); 如ftp://zhsoft:password@ftp.xxx.com/yyy.rpm(主机ftp.xxx.com,FTP用户名zhsoft,密码password)。 |
| * HTTP方式的命名:http://主机[:端口]/包裹文件 |
| 如(用HTTP获取主机上的yyy.rpm文件); 又如http://:8080/pub/yyy.rpm(用HTTP获取主机上/pub目录下的yyy.rpm文件,使用端口8080)。 |
| 3.其它形式(很少使用): |
| 命名格式:任意 |
| 1.hash(或-h):以#显示安装进度 |
| # rpm -i --hash MySQL-3.22.32-1.i386.rpm ################################################## # |
| 2.percent:以%(百分比)显示安装进度 |
| # rpm -i --percent MySQL-3.22.32-1.i386.rpm %% 0.000000 %% 0.002600 %% 0.020586 ...... %% 100.000000 # |
| 3.test:安装测试 |
| # rpm -i --test autofs-3.1.3-2.i386.rpm error: failed dependencies: mktemp is needed by autofs-3.1.3-2 # |
| # rpm -i mktemp-1.5-2.i386.rpm # rpm -i --test autofs-3.1.3-2.i386.rpm # |
| 4.replacepkgs:替换软件包 |
| # rpm -V file missing/usr/man/man1/file.1 # rpm -i file-3.26-6.i386.rpm package file-3.26-6 is already installed # |
| # rpm -i --replacepkgs file-3.26-6.i386.rpm # rpm -V file # |
| 5.replacefiles:替换文件 |
| # rpm -i ff-4.0-2.i386.rpm file /root/my.a from install of ff-4.0-2 conflicts with file from package zoo-6.0-1 # |
| # rpm -i --replacefiles ff-4.0-2.i386.rpm # |
| # rpm -i foo-6.0-1.i386.rpm warning: /etc/foo.conf saved as /etc/foo.conf.rpmorig # |
| 6.allfiles:安装所有文件 |
| # rpm -i foo-6.0-1.i386.rpm # ls -l /etc/foo.conf -rw-r--r-- 1 root root9 Oct 11 09:50 /etc/foo.conf # rm -f /etc/foo.conf # rpm -i --replacepkgs foo-6.0-1.i386.rpm # ls -l /etc/foo.conf ls: /etc/foo.conf: 文件或目录不存在 # rpm -i --replacepkgs --allfiles foo-6.0-1.i386.rpm # ls -l /etc/foo.conf -rw-r--r-- 1 root root9 Oct 11 09:50 /etc/foo.conf |
| 7.force:强制执行 |
| 8.excludedocs:不安装说明文档 |
| # rpm -i --excludedocs file-3.26-6.i386.rpm # ls -l /usr/man/man1/file.1 ls: /usr/man/man1/file.1: 文件或目录不存在 # ls -l /usr/man/man4/magic.4 ls: /usr/man/man4/magic.4: 文件或目录不存在 # |
| %_excludedocs 1 |
| # rpm -i file-3.26-6.i386.rpm # ls -l /usr/man/man1/file.1 ls: /usr/man/man1/file.1: 文件或目录不存在 # ls -l /usr/man/man4/magic.4 ls: /usr/man/man4/magic.4: 文件或目录不存在 # |
| 9.includedocs:安装说明文档 |
| # rpm -i --includedocs file-3.26-6.i386.rpm # ls -l /usr/man/man1/file.1 -rwxr-xr-x 1 root root12023 Mar 23 1999 /usr/man/man1/file.1 # ls -l /usr/man/man4/magic.4 -rwxr-xr-x 1 root root 6625 Mar 23 1999 /usr/man/man4/magic.4 # |
| 10.noscripts:不执行脚本程序 |
| # rpm -i foo-6.0-1.i386.rpm preinstall is running ... done postinstall is running ... done # |
| # rpm -i --noscripts foo-6.0-1.i386.rpm # |
| 11.nodeps:不检查依赖 |
| # rpm -i autofs-3.1.3-2.i386.rpm error: failed dependencies: mktemp is needed by autofs-3.1.3-2 # |
| # rpm -i --nodeps autofs-3.1.3-2.i386.rpm # |
| 12.notriggers:不执行触发程序 |
| 13.ignorearch:忽略体系与ignoreos :忽略操作系统 |
| 14.ignoresize:不检查空间大小 |
| 15.relocate:重定位 |
| # rpm -qpl file-3.26-6.i386.rpm /usr/bin/file /usr/man/man1/file.1 /usr/man/man4/magic.4 /usr/share/magic # rpm -i --relocate /usr=/tmp file-3.26-6.i386.rpm # rpm -ql file /tmp/bin/file /tmp/man/man1/file.1 /tmp/man/man4/magic.4 /tmp/share/magic # |
| 16.badreloc:强制重定位 |
| # rpm -i --relocate /usr/man=/tmp file-3.26-6.i386.rpm path /usr/man is not relocateable for package file-3.26-6 # |
| # rpm -i --relocate /usr/man=/tmp --badreloc file-3.26-6.i386.rpm # rpm -ql file /usr/bin/file /tmp/man1/file.1 /tmp/man4/magic.4 /usr/share/magic # |
| 17.excludepath:不安装指定目录下的文件 |
| # rpm -i --excludepath /usr/man file-3.26-6.i386.rpm # rpm -qls file normal/usr/bin/file not installed /usr/man/man1/file.1 not installed /usr/man/man4/magic.4 normal/usr/share/magic # |
| 18.justdb:仅更新数据库 |
| # rpm -i --justdb file-3.26-6.i386.rpm # rpm -qls file normal/usr/bin/file normal/usr/man/man1/file.1 normal/usr/man/man4/magic.4 normal/usr/share/magic # ls -l /usr/bin/file ls: /usr/bin/file: 文件或目录不存在 # |
| 19.prefix:指定重定位前缀 |
| # rpm -qpl file-3.26-6.i386.rpm /usr/bin/file /usr/man/man1/file.1 /usr/man/man4/magic.4 /usr/share/magic # rpm -i --prefix /tmp file-3.26-6.i386.rpm # rpm -ql file /tmp/bin/file /tmp/man/man1/file.1 /tmp/man/man4/magic.4 /tmp/share/magic # |
| 20.ftpproxy:指定FTP代理主机 |
| 21.ftpport:指定FTP端口 |
| # rpm -iv --ftpport 8888 ftp://root@xwboc/tmp/file-3.26-6.i386.rpm Password for root@xwboc: Password for root@xwboc: Retrieving ftp://root@xwboc/tmp/file-3.26-6.i386.rpm file-3.26-6 # |
| 22.httpproxy:指定HTTP代理主机 |
| 23.httpport:指定HTTP端口 |
| # rpm -iv --httpport 80 Retrieving autofs-3.1.3-2 # |
| 1.-v:显示附加信息 |
| # rpm -i file-3.26-6.i386.rpm # |
| # rpm -i -v file-3.26-6.i386.rpm file-3.26-6 # |
| 2.-vv:显示调试信息 |
| 3.root:指定根目录 |
| # rpm -i --root /usr file-3.26-6.i386.rpm failed to open /usr/var/lib/rpm/packages.rpm error: 不能打开 /usr/var/lib/rpm/packages.rpm # |
| 4.rcfile:指定RPM资源配置文件 |
| 5.dbpath:指定RPM数据库目录 |