当前位置:   article > 正文

阿里云服务器执行yum,一直下载docker-ce-stable失败_errors during downloading metadata for repository

errors during downloading metadata for repository 'docker-ce-stable':
  1. ~# yum update
  2. Docker CE Stable - x86_64 0.0 B/s | 0 B 02:00
  3. Errors during downloading metadata for repository 'docker-ce-stable':
  4. - Curl error (28): Timeout was reached for https://download.docker.com/linux/centos/8/x86_64/stable/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
  5. Error: Failed to download metadata for repo 'docker-ce-stable': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

这可能是由于YUM配置文件中包含了Docker仓库的配置,或者您的yum源中包含了Docker的相关依赖。您可以尝试以下步骤解决问题:

1. 查看YUM配置: 查看 `/etc/yum.repos.d/` 目录下是否有与Docker相关的repo文件,如`docker.repo`或`docker-ce.repo`,并临时移除或注释掉相关配置。

本人通过查看`/etc/yum.repos.d/` 目录,发现有docker-ce.repo,打开

  1. [docker-ce-stable]
  2. name=Docker CE Stable - $basearch
  3. baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
  4. enabled=1
  5. gpgcheck=1
  6. gpgkey=https://download.docker.com/linux/centos/gpg
  7. [docker-ce-stable-debuginfo]
  8. name=Docker CE Stable - Debuginfo $basearch
  9. baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/stable
  10. enabled=0
  11. gpgcheck=1
  12. gpgkey=https://download.docker.com/linux/centos/gpg
  13. [docker-ce-stable-source]
  14. name=Docker CE Stable - Sources
  15. baseurl=https://download.docker.com/linux/centos/$releasever/source/stable
  16. enabled=0
  17. gpgcheck=1
  18. gpgkey=https://download.docker.com/linux/centos/gpg
  19. [docker-ce-test]
  20. name=Docker CE Test - $basearch
  21. baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/test
  22. enabled=0
  23. gpgcheck=1
  24. gpgkey=https://download.docker.com/linux/centos/gpg
  25. [docker-ce-test-debuginfo]
  26. name=Docker CE Test - Debuginfo $basearch
  27. baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/test
  28. enabled=0
  29. gpgcheck=1
  30. gpgkey=https://download.docker.com/linux/centos/gpg
  31. [docker-ce-test-source]
  32. name=Docker CE Test - Sources
  33. baseurl=https://download.docker.com/linux/centos/$releasever/source/test
  34. enabled=0
  35. gpgcheck=1
  36. gpgkey=https://download.docker.com/linux/centos/gpg
  37. [docker-ce-nightly]
  38. name=Docker CE Nightly - $basearch
  39. baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/nightly
  40. enabled=0
  41. gpgcheck=1
  42. gpgkey=https://download.docker.com/linux/centos/gpg
  43. [docker-ce-nightly-debuginfo]
  44. name=Docker CE Nightly - Debuginfo $basearch
  45. baseurl=https://download.docker.com/linux/centos/$releasever/debug-$basearch/nightly
  46. enabled=0
  47. gpgcheck=1
  48. gpgkey=https://download.docker.com/linux/centos/gpg
  49. [docker-ce-nightly-source]
  50. name=Docker CE Nightly - Sources
  51. baseurl=https://download.docker.com/linux/centos/$releasever/source/nightly
  52. enabled=0
  53. gpgcheck=1
  54. gpgkey=https://download.docker.com/linux/centos/gpg

发现第4行,enabled=1,其他都是0,将其改为0,解决

2. 临时禁用Docker源: 在执行yum命令时,可以使用`--disablerepo=docker*`参数来临时忽略Docker仓库。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/在线问答5/article/detail/980866
推荐阅读
相关标签
  

闽ICP备14008679号