CentOS7更换阿里yum源

  • A+
所属分类:技术分享

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