在配置CentOS-6.0-x86_64-bin-DVD2.iso作為本地yum源的時候,,碰到相當(dāng)多的問題: ----------------------------------------- 問題一 ------------------------------------------ 將CentOS-6.0-x86_64-bin-DVD2.iso掛載在/mnt上,,并配置本地yum源: 然后就報(bào)錯了-_-!,,錯誤的信息差不多就是: file:///mnt/repodata/repomd.xml: [Errno 14] Could not open/read file:///mnt/repodata/repomd.xml . mistake from baseurl does not contain the repodata directory 問題出現(xiàn)的原因: CentOS-6.0-x86_64-bin-DVD2.iso這個鏡像里沒有包含yum的包索引數(shù)據(jù)庫repomd.xml,,這個文件一般是放在repodata文件夾的。所以,,不用特殊的工具,,這個CentOS-6.0-x86_64-bin-DVD2.iso中包含的Packages不能單獨(dú)作為yum的本地源。 ----------------------------------------- 問題二 ------------------------------------------ 在我的CentOS-6中,,/etc/yum.repos.d/目錄下本身已經(jīng)有3個已經(jīng)建好的repo庫了,,是Base、Media,、Debug,。 我自己新建一個software.repo,使用CentOS-6.0-x86_64-bin-DVD1.iso這個鏡像,,這個鏡像中包含repodata文件,。 但不管我怎么調(diào)整設(shè)置,用yum repolist命令都搜不到iso中包含的軟件包,,并且將所有的.repo中的enabled值都設(shè)置為1,,但使用yum repolist會提示錯誤: Could not retrieve mirrorlist http://mirrorlist./?release=6&arch=x86_64&repo=centosplus error was 14:
PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: centosplus.
Please verify its path and try again
解決方法:要使用自己新建的yum本地源,需要將系統(tǒng)本身提供的.repo庫暫時設(shè)置為禁用(enabled=0),,這樣的情況下,,使用yum repolist就可以正確的搜索iso提供的本地軟件包庫了。 附:建立本地yum源的步驟: 1,、將帶有軟件包和相應(yīng)repodata索引的iso鏡像掛載在某目錄下(我是放在/mnt下) 2,、在/etc/yum.repos.d/下建立自己的配置文件(例如software.repo),必須用.repo結(jié)尾,,內(nèi)容為:
3,、將yum.repos.d/目錄下得其他配置文件的enabled鍵值設(shè)置為0,,否則按順序執(zhí)行時會干擾自己建立的配置文件。 |
|