阿里云 Centos8 yum 镜像 404

Tosscat 杂乱教程评论175字数 498阅读1分39秒阅读模式

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

 

Tosscat
  • 本文由 发表于 2022年3月7日 22:19:22
  • 转载请务必保留本文链接:https://www.zhetengmao.com/1728.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: