Linux系统CentOS6 7 8更换阿里yum源的方法

配置方法:

1.备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下载   新的CentOS-Base.repo到/etc/yum.repos.d

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

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

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

3.更新缓存

yum clean all && yum makecache
yum update -y

 

上一篇:利用阿里云的源yum方式安装Mongodb


下一篇:Centos6无法使用yum源的问题 /var/cache/yum/x86_64/6/base/mirrorlist