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 following.you can use either less or cat command to view the file content. Some lines are removed due to brevity
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 existsince 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 cdrommount /dev/cdrom /media/CentOS/
4)Install your package using yumyum --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