How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 5.8

Share this Article :

In this post, i will share on how to setup local yum repository from CD-ROM/DVD-ROM image on CentOS 5.8. This quick setup will very useful for those who do not have internet connection and does not have yum repository server on their organization. Using local yum repository, you will able to perform yum installation using the available packages on your CD-ROM/DVD-ROM. This steps may be also working on other version of CentOS server.

1. Insert DVD/ISO into DVD-Drive.
2. Mount the ISO from the DVD-ROM into /mnt directory :

[[email protected] ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only

3. Create centos58.repo text file in /etc/yum.repos.d/ with the following content. Please create something as follow:

[[email protected] ~]# vi /etc/yum.repos.d/centos58.repo
[CentOS5.8-Repository]
name=DVD-CentOS5.8 repository
baseurl=file:///mnt
enabled=1
gpgcheck=0

4. Finish. You can start install, remove and update using yum command :
Example :

[[email protected] ~]# yum install httpd -y

Leave a Reply