Using Centos DVD as Yum Repository

Centos coming with dvd/cd as installation media, in some case you want to use it as yum repository. In this tech tips posting, I used centos 5.6 dvd.

1. Mount your dvd media under one of this directory as default :


I mount it under /media/CentOS directory, if not exist you should create it

# mount /dev/cdrom-hdc /media/CentOS

2. edit the configuration :

#vi /etc/yum.repos.d/CentOS-Media.repo

make sure enabled = 1

name=CentOS-$releasever - Media

Testing the repo:

3. If you want to use your dvd repo along another repo :

# yum --enablerepo=c5-media install package-name


# yum --enablerepo=c5-media install nmap

4. If you want to use only your dvd repo :

# yum --disablerepo=\* --enablerepo=c5-media install package-name

Example :

# yum --disablerepo=\* --enablerepo=c5-media install nmap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * c5-media: 
c5-media                                                                                                | 1.3 kB     00:00     
c5-media/primary                                                                                        | 1.2 MB     00:00     
c5-media                                                                                                             3539/3539
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:4.11-1.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

 Package                    Arch                         Version                          Repository                      Size
 nmap                       x86_64                       2:4.11-1.1                       c5-media                       680 k

Transaction Summary
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 680 k
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
c5-media/gpgkey                                                                                         | 1.5 kB     00:00     
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nmap                                                                                                    1/1 

  nmap.x86_64 2:4.11-1.1                                                                                                       


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 )

Google photo

You are commenting using your Google 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