2008年8月18日 星期一

YUM站台格式修正

如果有新增YUM站的朋友,最近UPDATE後可能會發生錯誤:
[root@msg ~]# yum -y update
Loading "fastestmirror" plugin
Config Error: File contains parsing errors: file://///etc/yum.repos.d/CentOS-Base.repo
[line 56]: [dag] [About 4052 Packages]
[line 63]: [dries] [About 2825 Packages]
[line 70]: [kbs-CentOS-Extras] [About 0 Packages]
[line 77]: [kbs-CentOS-Misc] [Not Ready]
[line 84]: [kbs-CentOS-Misc-Testing] [Not Ready]
[line 91]: [c5-testing] [About 80 Packages]

目前是發現更新到下列版本時會發生
yum.noarch 3.2.8-9.el5.centos.2.1
yum-updatesd.noarch 1:0.9-2.el5
yum-fastestmirror.noarch 1.1.10-9.el5.centos


發生錯誤的原因是在於站台名稱變的只容許第一段的[dag]、[dries]、[kbs-CentOS-Extras]、[kbs-CentOS-Misc]、[kbs-CentOS-Misc-Testing]、[c5-testing],後面註記的[About 4052 Packages]、[About 2825 Packages]、[About 0 Packages]、[Not Ready]、[Not Ready]、[About 80 Packages]必須刪除或是#處理掉,修改後的站台成為(For CentOS 5):
[dag]
name=Dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
gpgcheck=1
enabled=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

[dries]
name=Extra CentOS rpms dries - $releasever - $basearch
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/redhat/el5/en/i386/dries/RPMS
gpgcheck=1
enabled=0
gpgkey=http://dries.ulyssis.org/rpm/RPM-GPG-KEY.dries.txt

[kbs-CentOS-Extras]
name=CentOS.Karan.Org-EL$releasever - Stable
baseurl=http://centos.karan.org/el$releasever/extras/stable/$basearch/RPMS/
gpgcheck=1
enabled=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

[kbs-CentOS-Misc]
name=CentOS.Karan.Org-EL$releasever - Stable
baseurl=http://centos.karan.org/el$releasever/misc/stable/$basearch/RPMS/
gpgcheck=1
enabled=0
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

[kbs-CentOS-Misc-Testing]
name=CentOS.Karan.Org-EL$releasever - Testing
baseurl=http://centos.karan.org/el$releasever/misc/testing/i386/RPMS/
gpgcheck=1
enabled=0
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

9 意見:

匿名 提到...

請問[dag]、[dries]、[kbs-CentOS-Extras]、[kbs-CentOS-Misc]、[kbs-CentOS-Misc-Testing]、[c5-testing],是在哪呢?

Yow 提到...

那些是自己新增的~
直接把藍色那段貼上即可

匿名 提到...

不好意思大大!原etc/yum.repos.d/底下並無CentOS-Base.repo我自行新增CentOS-Base.repo並把您藍色那段貼上後執行yum update後會出現Error Summary

Yow 提到...

您是用CENTOS嗎?
是否有其他XXX-Base.repo的檔案?

匿名 提到...

是用CentOS5系統etc/yum.repos.d/底下原有mirrors-rpmforge與rpmforge.repo兩檔

Yow 提到...

執行 find / -name *.repo
搜尋看看有哪些檔案?

匿名 提到...

只有/etc/yum.repos.d/rpmforge.repo
/etc/yum.repos.d/CentOS-Base.repo
這兩個檔

Yow 提到...

/etc/yum.repos.d/CentOS-Base.repo
是你剛剛加上去的嗎?
試試看把下面這些站台加上去,加在[dag]前

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

你的YUM是怎麼安裝的?
一開始裝系統時就有安裝YUM嗎?

匿名 提到...

/etc/yum.repos.d/CentOS-Base.repo是我加上去的
YUM是前人所安裝的所以不是很清楚
照您的指導在[dag]前加入
已可更新~謝謝大大不厭其煩指盜

##EasyReadMore##