【问题标题】:Unable to run yum update无法运行 yum 更新
【发布时间】:2019-12-28 12:22:00
【问题描述】:

当我尝试运行时,我尝试运行 yum update 以开始使用 yum 工具

yum update

得到一个错误

在看到一些论坛的建议后,我已经禁用了 ipv6、firewalld 并将 dns 服务器设置为 8.8.8.8 和 8.8.4.4。

yum 更新的输出:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#7 - "Failed connect to mirrorlist.centos.org:80; Operation now in progress"


 One of the configured repositories failed (Unknown),
 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=<repoid> ...

     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 <repoid>
        or
            subscription-manager repos --disable=<repoid>

     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=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

【问题讨论】:

  • 听起来像是 DNS 问题。验证/etc/resolv.conf 更改,也许yum clean all
  • 其他想法...使用 `host` 确保您可以解析该 URI。你背后有代理? SELinux?其他防火墙。
  • 我的 DNS 已配置...我在我的 win 计算机中检查了我的代理设置,但我没有使用它。我有互联网连接,一切看起来都很好,所以我真的不明白我做错了什么......(我正在使用带有 cantos 图像的 virtualbox)

标签: centos centos7 yum


【解决方案1】:

大多数情况是因为你做了一个命令:

yum clean all

或任何导致 /etc/yum.repos.d/ 中的 repos 损坏或错误指向的东西

通常,它应该没问题,但有时它会导致 yum 损坏,如下所示,因为我现在尝试清理服务器 yum 存储库之一。 我在我处理的 9 台服务器中多次遇到此错误。您可以在 /etc/yum.repos.d/ 检查您的存储库。你应该能够看到这个:

如果您无法通过检查所有 .repo 文件来解决问题,请备份所有 .repo 并下载以下文件并将其上传到您的 /etc/yum.repos.d: https://drive.google.com/open?id=1WsJ1e8stj76JWJi-6IHQ1DVTmM7OsYzW

这将是之后的结果:

这确实是一个让您非常头疼的问题,只需简单的解决方案即可。我希望这真的能帮助到你。

【讨论】:

    猜你喜欢
    • 2015-01-26
    • 1970-01-01
    • 2015-07-09
    • 2014-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 1970-01-01
    相关资源
    最近更新 更多