yum error - centos 7.1 x86_64

时间:2015-05-24 14:55:31

标签: dns centos yum

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

[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

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

KO来自专用服务器:

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

OK从家里(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服务器。

3 个答案:

答案 0 :(得分:26)

我通过输入

解决了这个问题
# dhclient 

答案 1 :(得分:1)

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

使用

  

#dhclient

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

  

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

     

nameserver 8.8.8.8 [press:Esc] [press:wq]

     

希望它有用......!

答案 2 :(得分:0)

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

镜像列表=

baseURL时=

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

goodluck并享受linux中的yum包管理实用程序。

最好的问候-KB