Centos7-修改yum源和epel源为阿里云
1-切换到yum源所在目录
cd /etc/yum.repos.d
2-将旧yum原备份
mv CentOS-Base.repo CentOS-Base.repo.bak
3-使用wget获取阿里云源(wget安装)
wget http://mirrors.aliyun.com/repo/Centos-7.repo
4-把阿里云源改名为原文件名
mv Centos-7.repo CentOS-Base.repo
5-修改epel源
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
6-重新加载yum源
yum clean all
yum makecache
7-快速修改
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
wget http://mirrors.aliyun.com/repo/Centos-7.repo
mv Centos-7.repo CentOS-Base.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache