Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to disable a non-reachable repository?

I have an error when I use yum repolist or yum list:

# yum list | grep 404
CentOS_CentOS-    5/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.

And indeed the url is not reachable:

# ping opensuse.org
PING opensuse.org ( 56(84) bytes of data.
From icmp_seq=1 Destination Host Unreachable

But I can't find the repository in /etc/yum.conf:

# grep opensuse /etc/*
share|improve this question
Uhm... wait a second, getting a 404 HTTP Return Code means there has been a HTTP connection. – sr_ Dec 11 '12 at 21:02
up vote 0 down vote accepted

You need to search that host using -R option in grep.

grep -R opensuse  /etc/yum.repos.d/ | cut -d":" -f1

above command will print the exact matching files.

and you can comment that links on the fly using :

grep -R opensuse  /etc/yum.repos.d/ | cut -d":" -f1 | xargs -n1 sed -i.bkp "/opensuse/ s/^/#/"
share|improve this answer
I had an error "Cannot find a valid baseurl for repo" so I comment all the file and the errors disapear – Philippe Blayo Dec 12 '12 at 16:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.