配置阿里云yum源

CentOS6 
rm -f /etc/yum.repos.d/*
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo --no-check-certificate
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i  's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i  's/$releasever/6.9/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i  's/centos/centos-vault/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache


CentOS7

rm -f /etc/yum.repos.d/*
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i 's/\$releasever/7.9.2009/g' /etc/yum.repos.d/CentOS-Base.repo


CentOS8

rm -f /etc/yum.repos.d/*
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo


以上过期后,查看最新阿里云yum源配置
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.59aa1b11pw4up6
配置阿里云epel源
https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.59aa1b11pw4up6

posted on 2023-06-30 11:13  杨小杨~  阅读(157)  评论(0)    收藏  举报

导航