Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Install Packages via yum using CentOS Media repo

when need to Install new packages using yum, you can use either online Repo or dvd repo. If there is no internet connection, possible solution is DVD repo. Here is simple way to configure DVD repo on Centos.

1) View Centos media repo file.

Since I use Centos 6.3 it is similar to can use either less or cat command to view the file content. Some  lines are removed due to brevity

less /etc/yum.repos.d/CentOS-Media.repo
name=CentOS-$releasever - Media

give more attention to following parameters
repo name -> c6-media
baseurl -> there is 3 file paths, those are the mount point of Centos DVD. you can customize it.

2) Create mount point if not exist

since this is demo, I create DVD mount location as first base URL. possible use any location which is defined in baseurl.
[[email protected] ~]# mkdir /media/CentOS

3) mount centos cdrom

mount /dev/cdrom /media/CentOS/

4)Install your package using yum

yum --disablerepo=\* --enablerepo=[repo name] install [pakage name]

yum --disablerepo=\* --enablerepo=c6-media install cpan

if this is not working, you may need to clean repo using following command
[[email protected] ~]# yum clean all

This post first appeared on Shehan's Blog, please read the originial post: here

Share the post

Install Packages via yum using CentOS Media repo


Subscribe to Shehan's Blog

Get updates delivered right to your inbox!

Thank you for your subscription