阿里云 Centos8 yum 镜像 404

Linux 版本:阿里云 Centos 8.4


阿里云服务器 Centos8+ 使用 yum 命令时报错 404

- Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

1. 进入 yum 源目录

cd /etc/yum.repos.d/

2. 替换新的地址

for i in `ls`;do sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' $i;done
for i in `ls`;do sed -i 's/$releasever/$releasever-stream/g' $i;done

3. 添加缓存

yum clean all
yum makecache

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码

)">
< <上一篇
下一篇>>