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.
EX:-
yum -y install gcc*