Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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

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

4 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)

share|improve this answer
add comment

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

share|improve this answer
add comment

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
share|improve this answer
add comment

Have the same issue and it was cause by enabling media from local device (CD / DVD). It causes yum to lock up and had to kill the process to recover.

edit /etc/yum.repos.d/CentOS-Media.repo

notice the file names in the following section match the error baseurl=file:///media/CentOS/ file:///media/cdrom/ file:///media/cdrecorder/

Simply change enabled=1 to enabled=0 or do as quanta says as well.

share|improve this answer
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.