RPM Package Manager (RPM) 使用详解

来源:互联网 发布:波莫纳学院 知乎 编辑:程序博客网 时间:2024/05/22 22:40

1 About RPM

1、可以安装、删除、升级和管理软件;当然也支持在线安装和升级软件;
2、通过RPM包管理能知道软件包包含哪些文件,也能知道系统中的某个文件属于哪个软件包;
3、可以在查询系统中的软件包是否安装以及其版本;
4、作为开发者可以把自己的程序打包为RPM 包发布;
5、软件包签名GPG和MD5的导入、验证和签名发布
6、依赖性的检查,查看是否有软件包由于不兼容而扰乱了系统;

Welcome to the home of the official RPM Package Manager (RPM) code base!

RPM is a powerful and mature command-line driven package management system capable of installing, uninstalling, verifying, querying, and updating Unix software packages. Each software package consists of an archive of files along with information about the package like its version, a description, and the like. There is also a library API, permitting advanced developers to manage such transactions from programming languages such as C, Perl or Python.

Traditionally, RPM is a core component of many Linux distributions, including Red Hat Enterprise Linux, Fedora, Novell SUSE Linux Enterprise, openSUSE, CentOS, Mandriva Linux, and many others. But RPM is also used for software packaging on many other Unix operating systems like FreeBSD, Sun OpenSolaris, IBM AIX and Apple Mac OS X through the cross-platform Unix software distribution OpenPKG. Additionally, the RPM archive format is an official part of the Linux Standard Base (LSB).



2 rpm 执行安装包

rmp安装包分为两种:二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作为后缀名。

常用命令组合:

-ivh:安装显示安装进度--install--verbose--hash-Uvh:升级软件包--Update;-qpl:列出RPM软件包内的文件信息[Query Package list];-qpi:列出RPM软件包的描述信息[Query Package install package(s)];-qf:查找指定文件属于哪个RPM软件包[Query File];-Va:校验所有的RPM软件包,查找丢失的文件[View Lost];-e:删除包

以及

rpm -q samba //查询程序是否安装rpm -ivh  /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm //按路径安装并显示进度rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm    //指定安装目录rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm    //用来检查依赖关系;并不是真正的安装;rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm //新版本降级为旧版本rpm -qa | grep httpd      //[搜索指定rpm包是否安装]--all搜索*httpd*rpm -ql httpd         //[搜索rpm包]--list所有文件安装目录rpm -qpi Linux-1.4-6.i368.rpm //[查看rpm包]--query--package--install package信息rpm -qpf Linux-1.4-6.i368.rpm //[查看rpm包]--filerpm -qpR file.rpm       //[查看包]依赖关系rpm2cpio file.rpm |cpio -div    //[抽出文件]rpm -ivh file.rpm  //[安装新的rpm]--install--verbose--hashrpm -ivhrpm -Uvh file.rpm    //[升级一个rpm]--upgraderpm -e file.rpm      //[删除一个rpm包]--erase

看完这些例子其实已经差不多了,如果遇到其他需求,再查看帮助好了。

0 0
原创粉丝点击