【问题标题】:yum error - centos 7.1 x86_64百胜错误-centos 7.1 x86_64
【发布时间】:2015-05-24 14:55:30
【问题描述】:

我在专用服务器(由 OVH 托管)上遇到 yum 命令问题:

[root@mail-server ~]# yum clean all
[root@mail-server ~]# yum update
Modules complémentaires chargés : fastestmirror


 One of the configured repositories failed (Inconnu),
 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. Disable the repository, 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>

     4. 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

经过调查,我发现错误如下(从专用服务器返回的url不正确):

从专用服务器KO:

[root@mail-server ~]# curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
Invalid release
[root@mail-server ~]#

可以在家(ADSL)

MacBook-Air-de-John:~ jjohn$ curl "http://mirrorlist.centos.org/?release=7.1.1503&arch=x86_64&repo=os"
http://mirror.ate.info/ftp.centos.org/7.1.1503/os/x86_64/
http://ftp.rezopole.net/centos/7.1.1503/os/x86_64/
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/7.1.1503/os/x86_64/
http://mirror0.babylon.network/centos/7.1.1503/os/x86_64/
http://centos.crazyfrogs.org/7.1.1503/os/x86_64/
http://centos.mirrors.ovh.net/ftp.centos.org/7.1.1503/os/x86_64/
http://mirrors.ircam.fr/pub/CentOS/7.1.1503/os/x86_64/
ftp://ftp.free.fr/mirrors/ftp.centos.org/7.1.1503/os/x86_64/
http://mirror.ibcp.fr/pub/Centos/7.1.1503/os/x86_64/
http://ftp.ciril.fr/pub/linux/centos/7.1.1503/os/x86_64/
MacBook-Air-de-John:~ jjohn$

我在全新安装后在朋友的专用服务器(也由 OVH 托管)上遇到了同样的问题。

我不知道错误是来自 OVH 网络(DNS,...)还是 mirrorlist.centos.org 服务器。

【问题讨论】:

    标签: dns centos yum


    【解决方案1】:

    我通过输入解决了这个问题

    # dhclient 
    

    【讨论】:

    • 解决了我的问题 - 不知道为什么你得到了反对意见。
    • 请解释为什么这会有所帮助。抛出一个修复是可以的,但解释它为什么工作和应该使用可以教育用户,让他们了解他们在做什么。
    • 解决了我在 CentOS 上的问题,我从 ISO 安装了虚拟盒子中的所有内容。之后我还做了一个 sudo yum update
    【解决方案2】:

    您的 DNS 似乎无法解析 centos 镜像列表

    使用

    #dhclient

    或在“/etc/resolv.conf”文件中添加“nameserver 8.8.8.8”

    # vi /etc/resolv.conf [press i] 现在你处于插入模式

    名称服务器 8.8.8.8 [按:Esc][按:wq]

    #

    希望它工作..!

    【讨论】:

      【解决方案3】:

      首先你必须进入 /etc/yum.repos.d 目录并使用 vi 编辑器编辑 CentOS-Base.repo。寻找以下几行;

      镜像列表=

      baseurl=

      如果您在使用 yum 访问 baseurl/mirrorlist 网址时遇到困难,请删除 #baseurl 中的 # 符号,然后保存并退出 vi 编辑器。

      祝你好运,享受 linux 中的 yum 包管理实用程序。

      最好的问候-KB

      【讨论】:

        猜你喜欢
        • 2012-03-26
        • 2019-07-22
        • 2015-12-08
        • 1970-01-01
        • 2021-08-19
        • 2016-05-24
        • 1970-01-01
        • 1970-01-01
        • 2012-02-19
        相关资源
        最近更新 更多