怎样更新CentOS6.5的yum源

将yum源设置为国内yum源,能够提高软件包安装和更新的速度,同时避免一些常见软件版本没法找到。centos

 

国内源:能够使用wget获取或者直接下载缓存

网易:spa

CentOS5: http://mirrors.163.com/.help/CentOS5-Base-163.repocode

CentOS6: http://mirrors.163.com/.help/CentOS6-Base-163.repoblog

CentOS7: http://mirrors.163.com/.help/CentOS7-Base-163.repoget

 

中科大的yum源:软件

CentOS5: https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1配置

CentOS6: https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2date

CentOS7: https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3下载

 

sohu的yum源:

http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

 

这里以网易yum源为例

1、访问网易开源镜像站:http://mirrors.163.com/

 

2、如上图,点击 centos/ 后面的centos使用帮助

 

3、根据centos使用帮助操做:

[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

[2] 进入yum源配置文件所在文件夹
[root@localhost yum.repos.d]# cd /etc/yum.repos.d/

[3] 下载163的yum源配置文件,放入/etc/yum.repos.d/(操做前请作好相应备份)
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

[4] 运行yum makecache生成缓存

[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache

[5] 更新系统(可选)
[root@localhost yum.repos.d]# yum -y update

相关文章
相关标签/搜索