CentOS 5 较快yum配置(国内)

来源:互联网 发布:mac book pro 15寸 编辑:程序博客网 时间:2024/05/01 13:19

今天中午花了两个多小时用硬盘安装盘升级centos4.2到centos5.0,后来一直在寻找新的yum配置,网上一直找不到,最后自己改写了一些代码,服务器是sjtu的,国内的还比较快。

首先,由于直接升级,/etc/下出现了一个新的yum.conf.rpmnew,同时/etc/yum.repos.d/出现新的CentOS-Base.repo.rpmnew,实际旧的两个配置还是保留了,这两个是新的yum配置文件,首先把这2个覆盖旧配置。

代码:
#cd /etc
#cp yum.conf.rpmnew yum.conf
#cd /etc/yum.repos.d
#cp CentOS-Base.repo.rpmnew CentOS-Base.repo

需要注意的是,在yum.conf中启动了plugin支持,如果原来安装了旧的插件比如寻找最快源yum-fastestmirror,用在centos5中可能就会出错,所以必须先卸载或者把yum.conf中的plugin支持去掉,安装新的centos5的这个插件。

我的CentOS-Base.repo配置如下(sjtu的mirror,某些注释没去掉):

代码:

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

#released updates
[update]
name=CentOS-5 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5.2/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

baseurl=http://ftp.sjtu.edu.cn/centos/5.2/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

baseurl=http://ftp.sjtu.edu.cn/centos/5.2/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

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

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5.2/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5


摘自:http://www.linuxsir.org/bbs/showthread.php?p=1700622
原创粉丝点击