How to setup local yum repository

Create a directory to mount the .iso file

[root@homelinux sunil]# mkdir /mnt/rhl6

Copy rhel-server-6.1-x86_64-dvd.iso to the /tmp directory

Mount the linux .iso to rhl6 directory

[root@homelinux sunil]# mount -o loop /tmp/rhel-server-6.1-x86_64-dvd.iso /mnt/rhl6

Create a repository configuration file

[root@homelinux sunil]# vi /etc/yum.repos.d/local.repo

Add the following entry
[local repository]
name=RHEL6
Baseurl=file:///mnt/rhl6
enabled=1

Save & close the file

list the packages using yum list and yum install packagename to install the package.