13

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.

sunil
  • 231
  • 1
  • 2
  • 3

3 Answers3

26

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)

quanta
  • 50,327
  • 19
  • 152
  • 213
3

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
James Antill
  • 731
  • 1
  • 5
  • 10
0

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.

Jarrod
  • 111
  • 2