Create local repository using CD/DVD in CentOS/Redhat

Follow below steps to create yum repository using the CD/DVD

“/etc/yum.repos.d” is the location which contain all the files related to repository.

1) Login as root user
2) mount the cd/dvd

3) create a file in “/etc/yum.repos.d” named as “localrepo.repo” with below content

4) Execute “yum-config-manager –enable localrepo” to enable the repository

5) Execute “yum repolist” command to list the repos which are enabled

Now the creation of repository is completed and you can install the packages required using yum command.


yum -y install gcc*

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s