# 1.下载安装wget
yum install -y wget
# 2.备份默认的yum
mv /etc/yum.repos.d /etc/yum.repos.d.backup
# 3.设置新的yum目录
mkdir -p /etc/yum.repos.d
# 4.下载阿里yum配置到该目录中,选择对应版本
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 5.更新epel源为阿里云epel源
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 6.重建缓存
yum clean all
yum makecache
# 7.看一下yum仓库有多少包
yum repolist
还没有评论,来说两句吧...