CentOS 更新yum源

将yum源设置为国内yum源,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到。

国内源:可以使用wget获取或者直接下载

网易:

Centos5: http://mirrors.163.com/.help/CentOS5-Base-163.repo

Centos6: http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos7: http://mirrors.163.com/.help/CentOS7-Base-163.repo

 

中科大的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=2

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

安装步骤:

[1] 首先备份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] 下载网易的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份)
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

[4] 运行以下命令生成缓存

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

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

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

[6] 安装vim编辑器
[root@localhost ~]# yum -y install vim*

此文章参考自 https://blog.csdn.net/long690276759/article/details/53608921 和 https://zhidao.baidu.com/question/939037173162627572.html

猜你喜欢

转载自www.cnblogs.com/opsprobe/p/9419906.html