Monday, May 21, 2012

Using Redhat/CentOS DVD media as Yum repository

Installing from downloaded media is important for slow as well as limited connections. Anyway, I found a way to use CentOS media as a local yum repository. Here is how it is done:
Insert CentOS media onto your drive. Then, find the mount point where the media was mounted. It should be under /media. If not, mount the media onto a permanent location. Edit /etc/yum.repos.d/CentOS-Media.repo as:
vi /etc/yum.repos.d/CentOS-Media.repo
Modify the line containing baseurl to suit your environment i.e. the mount point. Also, note the repository name. For CentOS 6.2, it is 'c6-media'. Make sure 'enabled' is set to 1. Save the file using [escape]:x Now, run any yum command like:
yum --enablerepo=c6-media --disablerepo=\* install gcc
Yum priorities can also be used to give more priority to local installation media.

0 comments:

Post a Comment