linux - 更新阿里的镜像源


可能需要安装wget
yum install wget

更新阿里的数据源
1、yum源进行备份
进入到yum源的配置文件中
执行命令如下:cd /etc/yum.repos.d
将yum源进行备份:mv Centos-Base.repo Centos-Base.repo.bak
2、获取阿里的yum源配置文件
执行命令:wget -O Centos-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、对yum源生成缓存
执行命令:yum makecache
4、更新yum源
执行命令:yum -y install update

 

原文地址:https://www.cnblogs.com/c2g5201314/p/17440530.html