更改centos-yum鏡像網站
1.正常的話只要修改/etc/yum.repos.d/ CentOS-Base.repo這個檔案就好, 如果跟我一樣背的話請把/etc/yum.repos. d都複製一份做更改
2.修改檔案內容如下:
***CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
enabled=0
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://ftp.twaren.net/ Linux/CentOS/5/os/i386/<- 指向國家高速網路與計算中心
gpgcheck=1
enabled=0
***CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c5-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media
baseurl=http://dev.centos.org/ centos/5/testing/i386/<- 指向正確網路路徑
gpgcheck=1
enabled=1
gpgkey=http://dev.centos.org/ centos/<-指向正確網路路徑
***CentOS-Testing.repo
[c5-ft-testing]
name=CentOS-5 Fasttrack Testing
baseurl=http://dev.centos.org/ centos/5/testing/i386/<- 指向正確網路路徑
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/ centos/<-指向正確網路路徑
***mirrors-rpmforge
***mirrors-rpmforge-extras
***mirrors-rpmforge-testing
***rpmforge.repo
### Name: RPMforge RPM Repository for RHEL 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/ en/i386/rpmforge/<-確認正確網路路徑
mirrorlist = http://apt.sw.be/redhat/el5/ en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/ mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM- GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el5/ en/i386/extras/<-確認正確網路路徑
#mirrorlist = file:///etc/yum.repos.d/ mirrors-rpmforge-extras
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM- GPG-KEY-rpmforge-dag
gpgcheck = 1
[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el5/ en/i386/testing/<-確認正確網路路徑
#mirrorlist = file:///etc/yum.repos.d/ mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM- GPG-KEY-rpmforge-dag
gpgcheck = 1
以上都修改完 經過測試就能更新了,如果有GPG- KEY的問題請依照上面列出的檔案逐一再修正一次即可
install yum
rpm -Uvh http://mirror.centos.org/ centos/5/os/i386/CentOS/yum- metadata-parser-1.1.2-3.el5. centos.i386.rpm
wget http://mirror.centos.org/ centos/5/os/i386/CentOS/yum- fastestmirror-1.1.16-16.el5. centos.noarch.rpm
rpm -Uvh yum-*.rpm
yum -y update
失敗原因要多移除一個套件
rpm -e yum-metadata-parser-1.1.2-3. el5.centos.i386
沒有留言:
張貼留言