Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

yum error - centos 7.1 x86_64

Tags:

dns

centos

yum

I'm facing an issue with the yum command on a dedicated server (hosted by 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

After investigation, i found that the error bellow (the url return not ok from the dedicated server) :

KO From dedicated server :

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

OK From home (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$

I got the same issue after a fresh install and on a friend's dedicated server (hosted by OVH too).

I don't know if the error is coming from OVH network (DNS, ...) or mirrorlist.centos.org server.

like image 739
Elfoiros Avatar asked May 24 '15 14:05

Elfoiros


2 Answers

I solved the problem by typing

# dhclient 
like image 178
evargas Avatar answered Jan 03 '23 22:01

evargas


Your DNS doesn't seem to resolve the centos mirror list

Use

# dhclient

or Add "nameserver 8.8.8.8" in "/etc/resolv.conf" file

# vi /etc/resolv.conf [press i] now you are in insert mode

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

#

hope it work's..!

like image 43
Venkat G Avatar answered Jan 03 '23 22:01

Venkat G