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.

  • Did you run yum update to update the index file with the new set of repos? – Dave Sep 21 '11 at 23:01

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)


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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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