# 对于6及以下的可以使用:
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
# 需要具体到小版本
rel=`cat /etc/redhat-release |awk '{print $3}'`
# centos-vault为归档数据
sed -i 's#/centos/#/centos-vault/#g' /etc/yum.repos.d/CentOS-Base.repo
sed -i "s/\$releasever/$rel/g" /etc/yum.repos.d/CentOS-Base.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
# http://archives.fedoraproject.org/pub/archive/epel epel官方归档数据
sed -i 's#http://mirrors.aliyun.com/epel#http://archives.fedoraproject.org/pub/archive/epel#g' /etc/yum.repos.d/epel.repo
yum clean all
yum makecache
对于centos6及以下yum源使用
最新推荐文章于 2024-05-15 14:19:13 发布