CentOS7更换阿里yum源

更换之前确保自己安装wget

yum list wget
若没有安装:
yum -y install wget

首先备份原版/etc/yum.repos.d/CentOS-Base.repo

cd /etc/yum.repos.d
sudo mv CentOS-Base.repo CentOS-Base.repo.bak

下载阿里的yum源配置文件,放入/etc/yum.repos.d/CentOS-Base.repo

sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

运行yum makecache生成缓存

yum clean all
yum makecache
posted @ 2019-08-09 10:58  WindSun  阅读(15620)  评论(2编辑  收藏  举报
博客已停更,文章已转移,点击访问