RPM Package Manager (RPM) 使用詳解

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包]--file
rpm -qpR file.rpm       //[查看包]依賴關係
rpm2cpio file.rpm |cpio -div    //[抽出文件]

rpm -ivh file.rpm  //[安裝新的rpm]--install--verbose--hash
rpm -ivh

rpm -Uvh file.rpm    //[升級一個rpm]--upgrade
rpm -e file.rpm      //[刪除一個rpm包]--erase

看完這些例子其實已經差不多了,如果遇到其他需求,再查看幫助好了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章