一、错误背景描述
RHEL8系统工作正常,但恢复到安装后的初始镜像后,当安装软件时会提示如下错误:
Errors during downloading metadata for repository 'rhel-8-for-x86_64-appstream-rpms':
- Status code: 403 for https://cdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os/repodata/repomd.xml (IP: 23.66.152.83)
错误:为 repo 'rhel-8-for-x86_64-appstream-rpms' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
经检查,RHEL8系统网络正常,DNS解析没有问题,使用wget下载上面错误提示中的repomd.xml文件时,提示如下"cdn.redhat.com"的证书不可信错误:
[root@server ~]# wget https://cdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os/repodata/repomd.xml
--2022-07-06 17:06:38-- https://cdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os/repodata/repomd.xml
正在解析主机 cdn.redhat.com (cdn.redhat.com)... 23.66.152.83
正在连接 cdn.redhat.com (cdn.redhat.com)|23.66.152.83|:443... 已连接。
错误: “cdn.redhat.com” 的证书不可信。
错误: “cdn.redhat.com” 的证书颁发者未知。
二、解决办法
在“设置”的“详细信息”中,取消注册本系统,如下图所示
然后重新注册该系统即可。
也可以直接执行以下命令完成注册,其中的zhangsan和用户密码请用自己在开发者社区中注册的账号和密码代替哦。
[root@server ~]# subscription-manager register --username=zhangsan --password=用户密码 --auto-attach --force