Saturday, 30 April 2011

Setup a yum or up2date repository to use a locally mounted DVD with Red Hat Enterprise Linux 4, 5 and 6

For Red Hat Enterprise Linux 4
In /etc/sysconfig/rhn/sources, comment out the following line:

 # up2date default

This line needs to be commented out otherwise up2date will keep on looking for information using the Red Hat Network first.

Next, in the same file, create a line like the following:

 dir mydvdrepo /media/cdrom/RedHat/RPMS

Note: The CD/DVD must be mounted and available in the directory /media/cdrom/ and the path must point to the directory containing the RPMS.


For Red Hat Enterprise Linux 5
First please update the yum tool's version to yum-3.2.8-9 or higher. As there is a bug in RHEL5.1.
The url error has been fixed in yum version 3.1 and above according to:https://bugzilla.redhat.com/show_bug.cgi?id=212180


Second create a dvd.repo text file in /etc/yum.repos.d/ with the following content:

[dvd]
mediaid=1170972069.396645*
name=DVD for RHEL5
baseurl=file:///media/RHEL_5%20i386%20DVD/Server 
(For example for RHEL 5.5 version baseurl line should look like
'baseurl=file:///media/RHEL_5.5%20i386%20DVD/Serverenabled=1')
gpgcheck=0

(*) The mediaid= value comes from the .discinfo file located in the root of the DVD.

For example, to install the dovecot package using the new dvd.repo file, run yum with the --noplugins option so yum will not try to communicate with the Red Hat Network servers to fetch the package and its dependencies:

# yum install dovecot --noplugins
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package dovecot.i386 0:1.0-1.2.rc15.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 dovecot                 i386       1.0-1.2.rc15.el5  dvd              1.5 M

Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         

Total download size: 1.5 M

Is this ok [y/N]:

If problems occur while trying this procedure, run yum clean all and try running yum install again.

Note: This will only work for the "base" rpm pakages under the /Server directory; if access is needed to the rest of the software in the Red Hat Enterprise Linux Server DVD (Cluster, ClusterStorage and VT), add the following stanzas to the dvd.repo file:

[dvd-cluster]
mediaid=1170972069.396645
name=DVD for RHEL5 - Cluster
baseurl=file:///media/RHEL_5%20i386%20DVD/Cluster
enabled=1
gpgcheck=0

[dvd-cluster-storage]
mediaid=1170972069.396645
name=DVD for RHEL5 - ClusterStorage
baseurl=file:///media/RHEL_5%20i386%20DVD/ClusterStorage
enabled=1
gpgcheck=0

[dvd-vt]
mediaid=1170972069.396645
name=DVD for RHEL5 - VT
baseurl=file:///media/RHEL_5%20i386%20DVD/VT
enabled=1
gpgcheck=0

For more information, see man yum and the following related article:




For Red Hat Enterprise Linux 6

Mount RHEL 6 ISO to /media/rhel6

# mount -o loop RHEL6.0-20101111.0-Server-x86_64-DVD.iso /media/rhel6 

Copy media.repo file from the RHEL 6 ISO to /etc/yum.repos.d/

# cp /media/media.repo /etc/yum.repos.d/rhel6.repo 

Configure the repo file to point to the /media/rhel6

# vi /etc/yum.repos.d/rhel6.repo 

add following line

baseurl=file:///media/rhel6/Server

If you want to configure repository for HighAvailability , LoadBalancer , ResilientStorage ,  ScalableFileSystem then you can add following lines in rhel6.repo file

[dvd-HighAvailability]
mediaid=1289489697.332694
name=DVD for RHEL6 - HighAvailability
baseurl=file:///media/rhel6/HighAvailability
enabled=1
gpgcheck=0

[dvd-LoadBalancer]
mediaid=1289489697.332694
name=DVD for RHEL6 - LoadBalancer
baseurl=file:///media/rhel6/LoadBalancer
enabled=1
gpgcheck=0

[dvd-ResilientStorage]
mediaid=1289489697.332694
name=DVD for RHEL6 - ResilientStorage
baseurl=file:///media/rhel6/ResilientStorage
enabled=1
gpgcheck=0

[dvd-ScalableFileSystem]
mediaid=1289489697.332694
name=DVD for RHEL6 - ScalableFileSystem
baseurl=file:///media/rhel6/ScalableFileSystem
enabled=1
gpgcheck=0

No comments:

Post a Comment