一、下载阿里的镜像源

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

清除和创建缓存

yum clean all
yum makecache

随便安装一个组件

yum install -y yum-utils image.png

很显然,yum源配置有问题,需要修改

vim /etc/yum.repos.d/CentOS-Base.repo

image.png

需要把mirrors.cloud.aliyuncs.com替换成mirrors.aliyun.com 把releasever替换成releasever-stream

sed -i s#mirrors.cloud.aliyuncs.com#mioors.aliyuncss.com#g /etc/yum.repos.d/CentOS-Base.repo sed -i s#releasever#releasever-stream#g /etc/yum.repos.d/CentOS-Bse.repo

清除和创建缓存

yum clean all yum makecache

OK