Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to disable a non-reachable repository?

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

# yum list | grep 404
http://download.opensuse.org/repositories/home%3A/SannisDev/
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 (130.57.5.70) 56(84) bytes of data.
From 10.2.15.2 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.