At home I am having very slow internet connection, which becomes pain while downloading packages with yum. To make this process faster I have created local repository from CentOS media.
After installing CentOS you should have /etc/yum.repos.d/CentOS-Media.repo. We will be using the same repo file to create our local repository. Adjust the existing repo file as per our need

# CentOS-Media.repo
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c5-media [command]
# or for ONLY the media repo, do this:
#  yum --disablerepo=\* --enablerepo=c5-media [command]
name=CentOS-$releasever - Media

Now we need to mount cdrom to /media/CentOS/ or /media/cdrom/ or /media/cdrecorder/. I am having iso image of CentOS, so I will be mounting the same image at /media/cdrom

mount CentOS.iso /media/cdrom -o loop

How to use:

yum --enablerepo=c5-media install package_name
CentOS Local Repository
Tagged on:                                                                 

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recommend on Google