Sunday, May 5, 2013

CentOS : yum install problems - [Errno 14] Could not open / read file

Today I've just finished installing CentOS guest in VirtualBox for development server needs. As usual, the first thing I did was to install my favorite file editor / commander , the Midnight Commander (mc). But a strange thing happened when I tried to install mc:
[root@localhost ~]# yum install mc
Loaded plugins: fastestmirror, refresh-PackageKit, security
Loading mirror speeds from cached hostfile
 * Base: ossm.utm.my
 * C6-media:
 * Centosplus: ossm.utm.my
 * Extras: ossm.utm.my
 * Updates: ossm.utm.myfile :///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: Can not retrieve repository metadata (repomd.xml) for repository: c6-media. 
Please verify its path and try again
After searching for the cause, I can solved this problem quite easy. First, edit this file :
[root@localhost ~]# vi /etc/yum.repos.d/CentOS-Media.repo
Find a line labelled "enabled=1", then change its value into "enabled=0" (without quotes). Save the file, and try to repeat the installation.
[root@localhost ~]# yum install mc
Loaded plugins: fastestmirror, refresh-PackageKit, security
Loading mirror speeds from cached hostfile
 * Base: ossm.utm.my
 * Centosplus: ossm.utm.my
 * Extras: ossm.utm.my
 * Updates: ossm.utm.my
Setting up Install Process
Resolving Dependencies-> Running transaction check---> Package mc.x86_64 1:4.7.0.2-3. El6 will be installed
-> Finished Dependency Resolution
Dependencies Resolved================================================== 
Package Arch Version Repository Size===================================
Installing:
 mc x86_64 1:4.7.0.2-3. el6 base 1.6 M
Transaction Summary
=======================================================================
Install 1 Package (s)Total download size: 1.6 M
Installed size: 5.4 M
Is this ok [y / N]: y

Downloading Packages:mc-4.7.0.2-3.el6.x86_64.rpm | 1.6 MB 00:42
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: 1: mc-4.7.0.2-3.el6.x86_64 1/1
  Verifying: 1: mc-4.7.0.2-3.el6.x86_64 1/1Installed:
  mc.x86_64 1:4.7.0.2-3. el6
Complete!
[root@localhost ~]#

7 comments:

  1. Thanks for this post! It saved me a lot of time.

    ReplyDelete
  2. THANKS UR INFORMATION HELPED ME A LOT

    ReplyDelete
  3. Super. You are great.

    ReplyDelete
  4. how to solve this error? file:///media/cdrom/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/media/cdrom/repodata/repomd.xml'

    ReplyDelete
    Replies
    1. Raghavendra : had u read and tried what i'd write above step by step? seems like same problem

      Delete

Leave your comments with attitude please. This blog does DOFOLLOW :-)