docker 中报错 failure repodatarepomd.xml from mirrors.aliyun

当执行yum list docker-ce --showduplicates | sort-r时遇到HTTPSError404-NotFound错误,提示阿里云docker-ce仓库找不到。解决方案包括删除/etc/yum.repos.d目录下所有docker相关的repo,然后重新添加官方Docker仓库,如:yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

简述处理方法

进入 /etc/yum.repos.d 目录下,将所有有关 docker 的 repo 全部删掉
/etc/yum.repos.d

具体说明

当在执行 yum list docker-ce --showduplicates | sort -r 时,发现下面报错

[root@localhost yum.repos.d]# yum list docker-ce --showduplicates | sort -r
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.pro/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
正在尝试其它镜像。
To address this issue please refer to the below wiki article 

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.



 One of the configured repositories failed (added from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.pro),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro
        or
            subscription-manager repos --disable=mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro.skip_if_unavailable=true

failure: repodata/repomd.xml from mirrors.aliyun.com_docker-ce_linux_centos_docker-ce.pro: [Errno 256] No more mirrors to try.
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.pro/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
已加载插件:fastestmirror
 * updates: mirrors.aliyun.com
Loading mirror speeds from cached hostfile
 * extras: mirror01.idc.hinet.net
 * base: mirror.jdcloud.com```

报错原图:
报错图示

处理办法

切换到 /etc/yum.repos.d 目录下,将所有 docker 相关的 repo全部删掉
/etc/yum.repos.d
删除之后查看
删除之后查看
重新添加镜像

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

重新添加镜像之后查看

<think>好的,我需要帮助用户解决YUM源配置问题,具体是访问阿里云Docker镜像仓库时遇到HTTP 404错误。用户提到了错误信息是repodata/repomd.xml的HTTP Error 404 - Not Found。我需要根据提供的引用内容来找到解决方案。 首先,根据引用[1],CentOS 7的YUM源配置错误可能是因为镜像源地址失效或路径不正确。阿里云的镜像仓库结构可能发生了变化,导致原来的URL不可用。例如,旧的仓库路径可能不再维护,用户需要更新到正确的路径。 引用[2]提到的问题是关于证书信任问题,但用户现在遇到的是404错误,可能和证书无关,但这里提到更换镜像源或者检查证书设置可能有帮助。不过主要问题还是路径错误。 引用[3]给出的解决方法是删除现有的docker-ce.repo文件,然后重新生成缓存。这说明有时候旧的配置文件可能导致问题,需要清理后重新配置。 综合这些信息,解决步骤可能包括: 1. 检查当前使用的Docker镜像源URL是否正确。阿里云可能有新的路径结构,例如将/docker-ce/linux/centos/改为其他路径,或者版本号需要更新,比如从7改为8,但用户系统是CentOS 7的话,可能需要确认路径是否存在。 2. 确认系统版本是否匹配,比如CentOS 7的仓库是否被正确使用,而不是CentOS 8的路径。 3. 清除旧的YUM缓存和配置文件,特别是docker-ce.repo文件,然后重新添加正确的镜像源。 4. 更新YUM缓存,测试是否能正常访问新的仓库地址。 另外,可能还需要检查网络连接是否正常,是否有防火墙或代理设置导致无法访问阿里云镜像站。但根据错误信息,404更可能是路径问题而非连接问题。 需要确保用户按照最新的阿里云镜像站文档来配置Docker仓库,可能旧的教程中的URL已经过时。例如,正确的仓库配置步骤可能包括下载正确的repo文件或者手动编写正确的baseurl。 总结步骤应该是:备份现有配置,删除旧的docker相关repo文件,添加正确的新镜像源,然后执行yum clean和makecache,最后重新安装docker。</think>### 解决YUM源配置问题的分步指南 遇到阿里云Docker镜像仓库的HTTP 404错误,通常由镜像源路径失效或配置错误导致。以下是具体解决方法: --- #### **1. 检查镜像源地址有效性** 阿里云镜像仓库路径可能因版本更新而变化。例如,旧路径可能为: ```bash https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable ``` 但实际需要确认路径是否存在。可通过浏览器直接访问链接,若返回404,说明路径已失效。此时需参考[阿里云官方文档](https://developer.aliyun.com/mirror/docker-ce)更新为最新路径,例如: ```bash https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/x86_64/stable ``` 注意:`$releasever`需替换为实际系统版本(如CentOS 7应为`7`)[^1]。 --- #### **2. 清理旧配置文件并重新配置** - **删除旧仓库文件**: ```bash sudo rm -f /etc/yum.repos.d/docker-ce.repo ``` - **添加新镜像源**: 手动创建配置文件`/etc/yum.repos.d/docker-ce.repo`,内容如下: ```ini [docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable enabled=1 gpgcheck=0 ``` 确保`baseurl`与阿里云当前有效路径一致[^3]。 --- #### **3. 更新YUM缓存** 执行以下命令清理旧缓存并生成新缓存: ```bash sudo yum clean all sudo yum makecache ``` 若成功,会显示元数据缓存已生成。 --- #### **4. 验证并安装Docker** 重新尝试安装Docker: ```bash sudo yum install docker-ce ``` 若仍失败,检查网络连接或尝试临时关闭防火墙: ```bash sudo systemctl stop firewalld # CentOS 7 ``` --- #### **常见问题排查** - **证书问题**:若出现证书错误(如引用[2]),可添加`sslverify=0`到仓库配置中,或更新系统CA证书包。 - **路径兼容性**:CentOS 8与7的仓库路径可能不同,需严格匹配系统版本[^1][^2]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值