配置CentOS6 yum源

Centos 有个很方便的软件安装工具  yum,但是默认安装完centos,系统里使用的是国外的centos更新源,这就造成了我们使用默认更新源安装或者更新软件时速度很慢的问题。

为了使用yum工具能快速的安装更新软件,我们需要将默认的yum更新源配置为国内的更新源。yum更新源配置文件位于centos目录  /etc/yum.repos.d/  下。

首先提供几个国内快速的更新源:
教育网资源:
1 上海交大: http://ftp.sjtu.edu.cn/centos/

服务器位于北京,中国教育网网络中心,下载速度高达十M。
北方用户与教育网用户推荐,速度飞快。

2 中国科技大学:http://centos.ustc.edu.cn
服务器位于合肥。 南方用户推荐。 同样的,CenOS版本非常丰富,适合长期使用。

网上还有其他的资源,我测试了上海交大的就很好。达到8M/S

将/etc/yum.repos.d/CentOS-Base.repo,按照下面的进行修改

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#


[base]
name=CentOS-$releasever - Base
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-6


注意baseurl前面的#去掉,否则会提示baseurl未设置

假如替换其他的源,将新的网址替换http://ftp.sjtu.edu.cn/centos即可。

保存后,执行以下命令:

yum clean all
yum clean metadata
yum clean dbcache
yum makecache
yum update

注意:使用root进行以上操作。看看是不是yum update 很快很爽,非常快,而且这个IP还不是直连能上网的IP,是校园网内的IP。 对学生或者老师免费,呵呵学校的资源就是好啊!上Internet,一般网速10M/S,一年200!羡慕现在的211学校的学生!想当年使用兹娃兹娃的拨号上网,真是不堪回首!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值