QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5526|回复: 1

升级到centOS5后的较快yum配置(国内)

[复制链接]
发表于 2007-5-11 22:12:10 | 显示全部楼层 |阅读模式
今天中午花了两个多小时用硬盘安装盘升级centos4.2到centos5.0,后来一直在寻找新的yum配置,网上一直找不到,最后自己改写了一些代码,服务器是sjtu的,国内的还比较快。

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

[code:1]
#cd /etc
#cp yum.conf.rpmnew yum.conf
#cd /etc/yum.repos.d
#cp CentOS-Base.repo.rpmnew CentOS-Base.repo
[/code:1]
需要注意的是,在yum.conf中启动了plugin支持,如果原来安装了旧的插件比如寻找最快源yum-fastestmirror,用在centos5中可能就会出错,所以必须先卸载或者把yum.conf中的plugin支持去掉,安装新的centos5的这个插件。

我的CentOS-Base.repo配置如下(sjtu的mirror,某些注释没去掉):
[code:1]
[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.0/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.0/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.0/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.0/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.0/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.0/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
[/code:1]
发表于 2007-5-14 13:31:42 | 显示全部楼层
强啊..置顶
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 20:21 , Processed in 0.035938 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表