Convert RHN repositories (yum) with RHEL Media DVD repository

Posted on June 25, 2012

3


Step # 1

# pwd
/etc/yum.repos.d

Step # 2

# vi rhel-source.repo

Step # 3
You may see a result like below

[rhel-source]
name=Red Hat Enterprise Linux $releasever – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
~

Step # 4

Add the below lines on the top of file above

[Media]
name=RHELmedia
baseurl=file:///media/RHEL_6.2\ x86_64\ Disc\ 1/Server/
enabled=1
gpgcheck=0

OR (example)

[Media]
name=RHELmedia
baseurl=file:///media/
enabled=1
gpgcheck=0

Please Note: Keep enabled=1 for [Media] and mark enabled=0 for [rhel-source-beta] and [rhel-source] .

TIP:    If linux DVD is auto mounted, unmount it (umount -l MountPoint) and mount it again on /media. The same mount path should be mentioned under /etc/yum.repos.d/rhel-source.repo. (It happens with me that on default mounted path the activity does not successful)

Conclusion

Now you will be able to use yum command and the request will redirect to the DVD media of Redhat which you inserted in the CD/DVDrom (instead of going to internet/RHN)

Helpful Link

http://blog.sriunplugged.com/linux/adding-redhat-dvd-as-repository/

http://www.cyberciti.biz/tips/redhat-centos-fedora-linux-setup-repo.html  (In this way you may face the below error just apply the no gpgcheck option with yum)

 

#yum install xyz.rpm

Public key for xyz.rpm is not installed

#yum install –nogpgcheck PackageName.i686

Advertisements
Posted in: Tech News