Create another repo file name, example “dvd.repo”:
(Note: keep in mind that never use the default repo name, such as "redhat.repo", otherwise the repo file will be emptied automatically once perform "yum repolist")
# vi dvd.repo [dvd-source] name=RHEL 6.4 dvd repo baseurl=file:///media/Server enabled=1 gpgcheck=0 Check your repo config, Test and try to install the package: # yum repolist # yum install rpm-build [root@redhat64 yum.repos.d]# yum repolist Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. repo id repo name status dvd-source RHEL 6.4 dvd repo 3,648 repolist: 3,648 [root@redhat64 yum.repos.d]# yum install rpm-build Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. dvd-source | 3.9 kB 00:00 ... dvd-source/primary_db | 3.1 MB 00:00 ... Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package rpm-build.x86_64 0:4.8.0-32.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================= Package Arch Version Repository Size ========================================================================================================================= Installing: rpm-build x86_64 4.8.0-32.el6 dvd-source 126 k Transaction Summary ========================================================================================================================= Install 1 Package(s) Total download size: 126 k Installed size: 315 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Installing : rpm-build-4.8.0-32.el6.x86_64 [ ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [#### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [##### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [###### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [####### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [######## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################# ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [######################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [############################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################# ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [#################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [######################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [########################################## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [########################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [############################################ ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [############################################## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################################ ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################################# ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [######################################################## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [######################################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [########################################################## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################################################ ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################################################## ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [################################################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 [#################################################################### ] 1/1 Installing : rpm-build-4.8.0-32.el6.x86_64 1/1 dvd-source/productid | 1.7 kB 00:00 ... Verifying : rpm-build-4.8.0-32.el6.x86_64 1/1 Installed: rpm-build.x86_64 0:4.8.0-32.el6 Complete! [root@redhat64 yum.repos.d]#