yum常用命令及常用源

來源:互聯網
上載者:User
轉自:http://viong.blog.51cto.com/844766/278402rpm包的更新
檢查可更新的rpm包
#yum check-update
更新所有的rpm包
#yum update
更新指定的rpm包,如更新kernel和kernel source
#yum update kernel kernel-source
大規模的版本升級,與yum update不同的是,連舊的淘汰的包也升級
#yum upgrade rpm包的安裝和刪除
安裝rpm包,如xmms-mp3
#yum install xmms-mp3
刪除rpm包,包括與該包有倚賴性的包
#yum remove licq
注:同時會提示刪除licq-gnome,licq-qt,licq-textyum暫存(/var/cache/yum/)的相關參數
清除暫存中rpm 包檔案
#yum clean packages
清除暫存中rpm頭檔案
#yum clearn headers
清除暫存中舊的rpm頭檔案
#yum clean oldheaders
清除暫存中舊的rpm頭檔案和包檔案
#yum clearn 或#yum clearn all
注:相當於yum clean packages + yum clean oldheaders 包列表
列出資源庫中所有可以安裝或更新的rpm包
#yum list
列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包
#yum list mozilla#yum list mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla開頭的rpm包
列出資源庫中所有可以更新的rpm包
#yum list updates
列出已經安裝的所有的rpm包
#yum list installed
列出已經安裝的但是不包含在資源庫中的rpm包
#yum list extras
注:通過其他網站下載安裝的rpm包rpm包資訊顯示(info參數同list)
列出資源庫中所有可以安裝或更新的rpm包的資訊
#yum info
列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包的資訊
#yum info mozilla#yum info mozilla*
注:可以在rpm包名中使用匹配符,如列出所有以mozilla開頭的rpm包的資訊
列出資源庫中所有可以更新的rpm包的資訊
#yum info updates
列出已經安裝的所有的rpm包的資訊
#yum info installed
列出已經安裝的但是不包含在資源庫中的rpm包的資訊
#yum info extras
注:通過其他網站下載安裝的rpm包的資訊 搜尋rpm包
搜尋匹配特定字元的rpm包
#yum search mozilla
注:在rpm包名,包描述等中搜尋
搜尋有包含特定檔案名稱的rpm包
#yum provides realplay 增加資源庫
例如:增加rpm.livna.org作為資源庫
安裝Livna.org rpms GPG key
#rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY
檢查GPG Key
# rpm -qa gpg-pubkey*
顯示Key資訊
#rpm -qi gpg-pubkey-a109b1ec-3f6e28d5
(注:如果要刪除Key,使用#rpm -e gpg-pubkey-a109b1ec-3f6e28d5) yum常用的命令# yum install xxx            安裝xxx軟體# yum info xxx                查看xxx軟體的資訊# yum remove xxx        刪除套裝軟體# yum list                        列出套裝軟體# yum clean                    清除緩沖和舊的包# yum provides xxx        以xxx為關鍵字搜尋包(提供的資訊為關鍵字)# yum search xxx           搜尋套裝軟體(以名字為關鍵字)# yum groupupdate xxx# yum grouplist xxx# yum groupremove xxx這三個都是一組為單位進行升級 列表和刪除的操作。。比如 "Mysql Database"就是一個組會同時操作相關的所有套裝軟體;# yum update                系統升級# yum list available        列出所有升級源上的包;# yum list updates         列出所有升級源上的可以更新包;# yum list installed         列出已經安裝的包;# yun update kernel       升級內核; yum常用的源 1) 自動選擇最快的源由於yum中有的mirror速度是非常慢的,如果yum選擇了這個mirror,這個時候yum就會非常慢,對此,可以下載fastestmirror外掛程式,它會自動選擇最快的mirror:#yum install yum-fastestmirror設定檔:(一般不用動)/etc/yum/pluginconf.d/fastestmirror.conf你的yum鏡像的速度測試記錄檔案:/var/cache/yum/timedhosts.txt 2)使用圖形介面的yum如果覺得命令列的yum不方便,那麼可以使用圖形化的yumex,這個看起來更方便,因為可以自由地選擇軟體倉庫:#yum install yumex然後在系統工具中就可以看到yum extender了。實際上系統自帶的“添加/刪除程式“也可以實現圖形化的軟體安裝,但有些yumex的功能它沒有。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.