yum常用命令

2021-09-04 04:34:56 字數 2013 閱讀 4204

yum是乙個用於管理rpm包的後台程式,用python寫成,可以非常方便的解決rpm的依賴關係。在建立好yum伺服器後,yum客戶端可以通過

、ftp方式獲得軟體包,並使用方便的命令直接管理、更新所有的rpm包,甚至包括kernel的更新。現在把常用的yum命令引數整理如下:

一、列舉包檔案

列出資源庫中所有可以安裝或更新的rpm包

# yum list

列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包

# yum list perl //列出名為perl 的包

# yum list perl* //列出perl 開頭的包

列出資源庫中所有可以更新的rpm包

# yum list updates

列出已經安裝的所有的rpm包

# yum list installed

列出已經安裝的但是不包含在資源庫中的rpm包

# yum list extras

注:extras是repos.d中定義的資源列表名稱

二、列舉資源資訊

列出資源庫中所有可以安裝或更新的rpm包的資訊

# yum info

列出資源庫中特定的可以安裝或更新以及已經安裝的rpm包的資訊

# yum info perl //列出perl 包資訊

# yum info perl* //列出perl 開頭的所有包的資訊

列出資源庫中所有可以更新的rpm包的資訊

# yum info updates

列出已經安裝的所有的rpm包的資訊

# yum info installed

列出已經安裝的但是不包含在資源庫中的rpm包的資訊

# yum info extras

三、搜尋

搜尋匹配特定字元的rpm包

# yum search perl //在包名稱、包描述等中搜尋

搜尋有包含特定檔名的rpm包

# yum provides realplay

四、管理包

安裝rpm包

# yum install perl //安裝perl 包

# yum install perl* //安裝perl 開頭的包

刪除rpm包,包括與該包有倚賴性的包

# yum remove perl* //會刪除perl-* 所有包

軟體組管理

# yum groupinstall 「chinese support」 //安裝指定的組

# yum groupupdate 「chinese support」 //安裝了的組成員軟體包更新

# yum grouplist 「chinese support」 //安裝了的組和可以安裝的組一覽顯示

# yum groupremove 「chinese support」 //刪除指定的組

# yum groupinfo 「chinese support」 //指定組所包含的軟體包顯示

五、更新

檢查可更新的rpm包

# yum check-update

更新所有的rpm包

# yum update

更新指定的rpm包,如更新kernel和kernel source

# yum update kernel kernel-source

大規模的版本公升級,與yum update不同的是,連舊的淘汰的包也公升級

# yum upgrade

六、清空快取

清除暫存中rpm包檔案

# yum clean packages

清除暫存中rpm標頭檔案

# yum clearn headers

清除暫存中舊的rpm標頭檔案

# yum clean oldheaders

清除暫存中舊的rpm標頭檔案和包檔案

# yum clearn all

yum 常用命令

yum可以幫助我們方便的管理rpm包,什麼是rpm呢?rpm red hat package management,red hat軟體包管理 提供了一種構架,在這種架構下,可以在red hat enterprise linux fedora project suse linux enterprise...

yum常用命令

安裝軟體 以foo x.x.x.rpm為例 yum install foo x.x.x.rpm 刪除軟體 yum remove foo x.x.x.rpm或者yum erase foo x.x.x.rpm 公升級軟體 yum upgrade foo或者yum update foo 查詢資訊 yum ...

yum常用命令

yum針對軟體包操作常用命令 1.使用yum查詢軟體包 命令 yum search 2.列出所有可安裝的軟體包 命令 yum list 3.列出所有可更新的軟體包 命令 yum list updates 4.列出所有已安裝的軟體包 命令 yum list installed 5.列出所有已安裝但不在...