自动安装
yum -y install epel-release
手动安装
cd /etc/yum.repos.d
centos 6
http://mirrors.aliyun.com/repo/Centos-6.repo
centos 7
http://mirrors.aliyun.com/repo/Centos-7.repo
mv Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
如果只想让上面的Yum源生效,可以将在/etc/yum.repos.d目录下创建一个backup目录,并将其它.repo文件都移到这个backup目录中。
更新yum源
yum clean all
yum makecache
运行yum repolist all
来查看Yum源。
国内的yum源
原文:https://www.cnblogs.com/weidaijie/p/9573607.html