【错误1】:
[root@ngx yum.repos.d]# yum makecache
CentOS Linux 8 - AppStream 146 B/s | 153 B 00:01
Errors during downloading metadata for repository 'appstream':
- Status code: 404 for https://mirrors.tuna.tsinghua.edu.cn/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 101.6.15.130)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@ngx yum.repos.d]#
【处理】:
修改 /etc/yum.repos.d/CentOS-Linux-AppStream.repo
确定正确的-repo路径
Index of /centos/8-stream/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

修改如下绿底部分内容为:
[root@ngx yum.repos.d]# cat /etc/yum.repos.d/CentOS-Linux-AppStream.repo
….
[appstream]
name=CentOS Linux $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/AppStream/$basearch/os/
--> baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[root@ngx yum.repos.d]#
【 错误2】:
[root@ngx yum.repos.d]# yum makecache
CentOS Linux 8 - AppStream 4.3 kB/s | 4.4 kB 00:01
CentOS Linux 8 - BaseOS 123 B/s | 153 B 00:01
Errors during downloading metadata for repository 'baseos':
- Status code: 404 for https://mirrors.tuna.tsinghua.edu.cn/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 101.6.15.130)
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@ngx yum.repos.d]#
【处理】
此问题还是,清华源的路径没有配置正确
修改/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
[baseos]
name=CentOS Linux $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/BaseOS/$basearch/os/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever-stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
【结果】:
[root@ngx yum.repos.d]# yum makecache
CentOS Linux 8 - AppStream 6.2 kB/s | 4.4 kB 00:00
CentOS Linux 8 - BaseOS 610 kB/s | 19 MB 00:32
CentOS Linux 8 - Extras 3.4 kB/s | 10 kB 00:03
Metadata cache created.
[root@ngx yum.repos.d]#
本文介绍了如何解决在CentOS8系统中使用清华源下载AppStream和BaseOS repomd.xml文件时遇到的404错误。通过检查并修改CentOS-Linux-AppStream.repo和CentOS-Linux-BaseOS.repo文件,将URL中的'8'替换为'8-stream',从而修复了下载问题,成功创建了metadata缓存。

791

被折叠的 条评论
为什么被折叠?



