日期:2014-05-17  浏览次数:20743 次

rpm鍛戒护 http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/08/2203153.html

rpm 鍙傛暟锛?/p>

锛峣vh锛氬畨瑁呮樉绀哄畨瑁呰繘搴?-install--verbose--hash
锛峌vh锛氬崌绾ц蒋浠跺寘--Update锛?
锛峲pl锛氬垪鍑篟PM杞欢鍖呭唴鐨勬枃浠朵俊鎭痆Query Package list]锛?
锛峲pi锛氬垪鍑篟PM杞欢鍖呯殑鎻忚堪淇℃伅[Query Package install package(s)]锛?
锛峲f锛氭煡鎵炬寚瀹氭枃浠跺睘浜庡摢涓猂PM杞欢鍖匸Query File]锛?
锛峍a锛氭牎楠屾墍鏈夌殑RPM杞欢鍖咃紝鏌ユ壘涓㈠け鐨勬枃浠禰View Lost]锛?
锛峞锛氬垹闄ゅ寘

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銆€銆€銆€ //鐢ㄦ潵妫€鏌ヤ緷璧栧叧绯伙紱骞朵笉鏄湡姝g殑瀹夎锛?
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    锛僛鍗囩骇涓€涓猺pm]--upgrade
rpm -e file.rpm      锛僛鍒犻櫎涓€涓猺pm鍖匽--erase

聽甯哥敤鍙傛暟锛?/p>

-i, --install                     install package(s)
-v, --verbose                     provide more detailed output
-h, --hash                        print hash marks as package installs (good with -v)
-e, --erase                       erase (uninstall) package
-U, --upgrade=<packagefile>+      upgrade package(s)
锛?replacepkge                    鏃犺杞欢鍖呮槸鍚﹀凡琚畨瑁咃紝閮藉己琛屽畨瑁呰蒋浠跺寘
--test                            瀹夎娴嬭瘯锛屽苟涓嶅疄闄呭畨瑁?
--nodeps                          蹇界暐杞欢鍖呯殑渚濊禆鍏崇郴寮鸿瀹夎
--force                           蹇界暐杞欢鍖呭強鏂囦欢鐨勫啿绐?

Query options (with -q or --query):
-a, --all                         query/verify all packages
-p, --package                     query/verify a package file
-l, --list                        list files in package
-d, --docfiles                    list all documentation files
-f, --file                        query/verify package(s) owning file