YUM顧名思義,Yellow Dog Updater, Modified. Yum為基於RPM系統做了相同的工作。它提供了一個簡單的命令,可用於在首先安裝和更新任何其他必要的軟體包以滿足所需的軟體包依賴關係之後,自動化安裝或更新一個軟體包,類似Debian下apt-get的工具.
YUM的特點:
可以同時配置多個資產庫(Repository)
簡潔的設定檔(/etc/yum.conf
自動解決增加或刪除rpm包時遇到的倚賴性問題
使用方便
保持與RPM資料庫的一致性
RHEL AS5可以通過Yum升級系統的功能,但預設rhel-debuginfo.repo 的設定是從RedHat的Yum源來升級系統,如果您沒有購買Redhat的服務,Redhat5後面版本升級是收費,需要key才能升級,那麼使用Yum是無法升級的。幸運的是,由於centos是免費的企業版本,可以借用centos yum源更新RHEL AS5系統.
配置YUM 從centos5源更新軟體
[root@clinet ~]# rpm --import http://ftp.twaren.net/Linux/CentOS/RPM-GPG-KEY-CentOS-5
安裝那個ftp.twaren.net的GPG,也可增加其他資產庫,自己選擇一個離自己地理位置近點
[root@clinet ~]# rpm -qa gpg-pubkey*
檢查GPG Key
gpg-pubkey-e8562897-459f07a4
如果要刪除Key,使用以下命令:
[root@clinet ~]# rpm -e gpg-pubkey-e8562897-459f07a4
[root@clinet ~]# vi /etc/yum.repos.d/rhel-debuginfo.repo
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
baseurl是你的YUM源地址
enabled=0
是否啟用這個倉庫,1為起用,0為禁用
gpgcheck=1
設定gpgcheck=1會讓yum檢查每個下載的RPM的GnuPG簽名。這麼做是因為你需要適當的GnuPG key註冊到您的RPM資料庫。可以防止被欺騙,如:非法入侵發行版網站,木馬匯入軟體包,使不知情使用者下載
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
GPGKEY 的存放地址
以上預設有的,複製添加以下更新點插入到rhel-debuginfo.repo文本裡後面
[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://ftp.twaren.net/Linux/CentOS/5/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://ftp.twaren.net/Linux/CentOS/5/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://ftp.twaren.net/Linux/CentOS/5/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux $releasever -Addons
baseurl=http://ftp.twaren.net/Linux/CentOS/5/addons/$basearch/
gpgcheck=1
[root@clinet ~]#yum clean all 清除緩衝及舊的包
[root@clinet ~]# yum install httpd 測試是否能更新軟體