Create Repo using CD in linux

Most of the times in case of RHEL you do not have valid or activated subscription for your RHEL OS hence yum fails to work properly there. In that case you can download the ISO image of the required OS version and can mount it in the server. Once the CD is mounted you can use that mounted cd to create repo using that cd which will help you to run yum commands

Steps to create repo from the CD

Download the required ISO on the server

Mount that ISO file on the server

mount -t iso9660 -o loop /home/adminnotes/Fedora-18-i386-DVD.iso /mnt/iso/

Go to yum repo directory

cd /etc/yum.repos.d/

Create a repo file called cd.repo and paste below content in it

[InstallMedia]
name=DVD for Red Hat Enterprise Linux 7.1 Server
mediaid=1359576196.686790
metadata_expire=-1
gpgcheck=1
cost=500
enabled=1
baseurl=file:///mnt/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Run yum clean all

yum clean all

Your yum should run fine now using cd repository

Confirm this by running

yum install wget

Leave a Comment