Here's what I did:
- Create a directory to mount the cd into. Here's the command:
mkdir /media/rhel62 - Mount RHEL 6 ISO to /media/rhel6
here's the command:
mount -o loop RHEL6.2-20111117.0-Server-x86_64-DVD1.iso /media/rhel62 - Copy media.repo file from the RHEL ISO to /etc/yum.repos.d/
here's the command:
cp /media/rhel62/media.repo /etc/yum.repos.d/rhel6.repo - Configure the repo file to point to the /media/rhel6. To do so open the file /etc/yum.repos.d/rhel6.repo and add following line
baseurl=file:///media/rhel62/Server
It is a good idea to change the repo name by changing the string contained in the [ ] at the beginning of the file - Create the repository package. Here's the command:
yum install createrepo - Create a directory to store the repodata file into and create the repository. I used /repodata. So the commands are:
mkdir /repodata
cd /repodata
createrepo . - Finally clean up
yum clean all
From now on every yum install command will get the updates from the CD.
Don't forget to automount the iso image, so that your settings are preserved after a reboot.
To do so add the following line in /etc/fstab:
/tmp/RHEL6.2-20111117.0-Server-x86_64-DVD1.iso /media/rhel62 iso9660 loop,ro,auto 0 0
Please Note: if you want to use the same method for other features in Redhat linux such as HighAvailability , LoadBalancer , ResilientStorage and ScalableFileSystem then you 'll need to add more lines in the rhel6.repo file. Here's a link to the source of the information I presented:
https://access.redhat.com/knowledge/node/9743
No comments:
Post a Comment