1. 備份yum源
cd /etc/yum.repos.d mkdir repo_bak mv *.repo repo_bak/
2. 下載阿里雲repo文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3. 清空yum緩存,並生成新的yum緩存
yum clean all yum makecache
4. 安裝軟件擴展源
yum install -y epel-release