1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - Linux系统 - centos - 正文

君子好学,自强不息!

centos6更新yum源为阿里云

2023-02-26 | centos | admin | 6127°c
A+ A-

[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源配置文件所在文件夹

cd /etc/yum.repos.d/

[3] 下载163或者阿里云的yum源配置文件,放入/etc/yum.repos.d/(操作前请做好相应备份)

163:

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

centos5:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

centos6:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

centos7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[4] 运行yum makecache生成缓存

yum makecache

[5] 更新系统

yum -y update

参考链接:

centOS更改yum源与更新系统

超简单将Centos的yum源更换为国内的阿里云源

本文来源:1818IP

本文地址:https://www.1818ip.com/post/32892.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。