轉自:http://lhx2003.bokee.com/viewdiary.41149845.html
Yum(全稱為 Yellow dog Updater, Modified)是一個在Fedora和redhat中的Shell前端軟件包管理器。基於RPM包管理,能夠從指定的服務器自動下載RPM包並且安裝,可以自動處理依賴性關系,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。
接觸了yum的不久,就開始按照要求,配置了一個yum,但是折騰了大半天“/repodata/repomd.xml”的錯誤一直到現在才明白。這不,寫下來與大家分享,以此日志。
/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=file:///mnt/ ##安裝文件的目錄,這是從局域網中掛載的rhel5.2的安裝包和文件
enabled=1
gpgcheck=1 ##1為激活gpg檢測,0為否
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release ##、mnt下對應的rpm包的驗證文件
[root@test mnt]# yum list
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
ftp:///mnt/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] no host given
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-debuginfo. Please verify its path and try again
上述中的repodata/repomd.xml文件據說是/mnt目錄rpm包的目錄,路徑
在/mnt中因為沒有/repodata/repomd.xml 這個文件,所以提示出錯,其實不是網上所說的軟件庫路徑的問題。這也是明明在/mnt下看到我們要安裝的包,而提示沒有的緣故。
在網上找到centos的安裝源http://centos.ustc.edu.cn/centos/5/os/i386/,替換掉上面的baseurl后,經測試正常!因為是rhel和centos有些不同的原因,提示某些包的Public key沒有安裝,如下:
Public key for httpd-2.2.3-11.el5_1.centos.3.i386.rpm is not installed
但httpd服務已經安裝了。
從這些看出,不是我們的配置問題,而是/repodata/repomd.xml這個文件不存在。其實錯誤已經很明顯提示了!