I was trying to install a few packages on a compute node using yum, when I encountered the following problem:-

“IOError”

Here is how it happened:-

[root@localhost yum.repos.d]# yum install opensm

Loading “rhnplugin” plugin
Loading “security” plugin
Loading “installonlyn” plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
rhel51 100% |=========================| 1.3 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 780 kB 00:00
################################################## 2857/2857
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for opensm to pack into transaction set.
media://1192663619.181374%233/opensm-3.0.3-6.el5.x86_64.rpm: [Errno 4] IOError:
Trying other mirror.
Error: failed to retrieve opensm-3.0.3-6.el5.x86_64.rpm from rhel51
error was [Errno 4] IOError:
[root@localhost yum.repos.d]#

Here is the setup:-

A master node and two compute nodes were installed from the CD directly. On the master node, I copied the entire RHEL 5.1 cds in a directory tree and made that available through apache:-

Master Node (192.168.20.100) :-

[root@headnode ~]# cat /etc/httpd/conf.d/rhel51.conf  
Alias /rhel51 /data/RHEL_5.1  
  
Order deny,allow  
Allow from all  
  
[root@headnode ~]#           

On my compute node side, I setup the yum repository as follows:-

[root@localhost firmware]# cat /etc/yum.repos.d/rhel51.repo  
[rhel51]  
name=Red Hat Enterprise Linux 5.1  
baseurl=http://192.168.20.100/rhel51/Server/  
enabled=1  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release  
[root@localhost firmware]#    

The moment I tried to install a package, I got the error, as shown in the beginning. The error comes because the files were directly copied from the CD set into the /data/RHEL_5.1 directory. It should have worked without a problem, but for some unknown reason (bug), the files still think that they are on a CD media, named “media://1192663619.181374%233” . To fix this, we need to recreate / update the repository on the master node.

Here is how:-

Goto the master node / headnode and into the directory where you can see the subdirectory named repodata. Do not go inside repodata directory. Just stay one level up outside, in the “Server” or “Packages” directory. Then, issue the createrepo command. You need to have createrepo pakcage installed on your system before you do it.

[root@headnode ~]# yum -y install createrepo  
[root@headnode ~]# cd /data/RHEL_5.1/Server  
  
[root@headnode Server]# createrepo  -v  .  

or simply:

[root@headnode Server]# createrepo .

That is all on the server side. Now go to the client node, and do the following:-

[root@localhost firmware]# yum clean all  
Loading "rhnplugin" plugin  
Loading "installonlyn" plugin  
Loading "security" plugin  
This system is not registered with RHN.  
RHN support will be disabled.  
Cleaning up Everything  
[root@localhost firmware]#  

Now you can install your packages:-

[root@localhost yum.repos.d]# yum install opensm  
Loading "rhnplugin" plugin  
Loading "security" plugin  
Loading "installonlyn" plugin  
This system is not registered with RHN.  
RHN support will be disabled.  
Setting up Install Process  
Setting up repositories  
rhel51                    100% |=========================|  951 B    00:00  
Reading repository metadata in from local files  
primary.xml.gz            100% |=========================| 979 kB    00:00  
################################################## 2857/2857  
Parsing package install arguments  
Resolving Dependencies  
--> Populating transaction set with selected packages. Please wait.  
---> Downloading header for opensm to pack into transaction set.  
opensm-3.0.3-6.el5.x86_64 100% |=========================| 9.5 kB    00:00  
---> Package opensm.x86_64 0:3.0.3-6.el5 set to be updated  
--> Running transaction check  
--> Processing Dependency: libibcommon.so.1()(64bit) for package: opensm  
...  
...  
--> Restarting Dependency Resolution with new changes.  
--> Populating transaction set with selected packages. Please wait.  
---> Downloading header for openib to pack into transaction set.  
openib-1.2-6.el5.x86_64.r 100% |=========================|  12 kB    00:00  
---> Package openib.x86_64 0:1.2-6.el5 set to be updated  
--> Running transaction check  
  
Dependencies Resolved  
  
=============================================================================  
Package                 Arch       Version          Repository        Size  
=============================================================================  
Installing:  
opensm                  x86_64     3.0.3-6.el5      rhel51            281 k  
Installing for dependencies:  
libibcommon             x86_64     1.0.3-6.el5      rhel51             13 k  
libibumad               x86_64     1.0.5-6.el5      rhel51             18 k  
openib                  x86_64     1.2-6.el5        rhel51            113 k  
opensm-libs             x86_64     3.0.3-6.el5      rhel51             70 k  
  
Transaction Summary  
=============================================================================  
Install      5 Package(s)  
Update       0 Package(s)  
Remove       0 Package(s)  
  
Total download size: 495 k  
Is this ok [y/N]: y  
Downloading Packages:  
(1/5): opensm-libs-3.0.3- 100% |=========================|  70 kB    00:00  
(2/5): libibumad-1.0.5-6. 100% |=========================|  18 kB    00:00  
(3/5): openib-1.2-6.el5.x 100% |=========================| 113 kB    00:00  
(4/5): opensm-3.0.3-6.el5 100% |=========================| 281 kB    00:00  
(5/5): libibcommon-1.0.3- 100% |=========================|  13 kB    00:00  
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186  
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) "  
Is this ok [y/N]: y  
Running Transaction Test  
Finished Transaction Test  
Transaction Test Succeeded  
Running Transaction  
Installing: openib                       ######################### [1/5]  
Installing: libibcommon                  ######################### [2/5]  
Installing: libibumad                    ######################### [3/5]  
Installing: opensm-libs                  ######################### [4/5]  
Installing: opensm                       ######################### [5/5]  
  
Installed: opensm.x86_64 0:3.0.3-6.el5  
Dependency Installed: libibcommon.x86_64 0:1.0.3-6.el5 libibumad.x86_64 0:1.0.5-6.el5 openib.x86_64 0:1.2-6.el5 opensm-libs.x86_64 0:3.0.3-6.el5  
Complete!  
[root@localhost yum.repos.d]#