centos修改yum源为阿里yum源

年爸 1年前 ⋅ 421 阅读

1.删除老版的yum文件

rm -rf /etc/yum.repos.d
mkdir /etc/yum.repos.d

2.找到阿里云镜像,下载repo

#centos 7
wget http://mirrors.aliyun.com/repo/Centos-7.repo
cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
#centos 8
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo


3.清理yum缓存,重新安装

yum clean all
yum makecache
yum update

全部评论: 0

    我有话说: