一:先备份文件,在配置失败时可以恢复
- cd /etc/yum.repos.d
- mkdir back
- mv *.repo back
二:下载阿里云yum源
- wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
- wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
三:生产缓存
- yum clean all
- rm -rf /var/cache/yum/
- yum makecache
配置完成,完成信息如下: