When I search for a package in yum(centos 6), it tries to search in a repro named 'c6-media' And it gives a bunch of errors as follows

file:///media/CentOS/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml
Trying other mirror.
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrecorder/repodata/repomd.xml
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/cdrom/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: c6-media. Please verify its path and try again

Obviously the error seems to say that yum is trying to search for the CD/DVD which installed the OS. I do not have it now. All I want to do now is to delete this repository from yum. I went to the package manager graphical tool and removed this from the sources. Seems yum and the graphical tool do not use the same config. This is just my guess.

link|improve this question
feedback

migrated from stackoverflow.com Sep 22 '11 at 16:25

This question came from our site for professional and enthusiast programmers.

3 Answers

All the yum repos located at /etc/yum.repos.d/. So, you can remove a repo with:

# rm -f /etc/yum.repos.d/c6-media.repo

Or temporary disable it with:

# yum --disablerepo=c6-media search ...

(Change enabled=1 to enabled=0 in c6-media.repo for permanent)

link|improve this answer
feedback

Did you run yum update to update the index file with the new set of repos?

link|improve this answer
feedback

New in 6.0 or 6.1 (can't remember which off hand) is yum-config-manager, which you can use to disable a repo.:

yum-config-manager --disable c6-media
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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