忘记转载哪里了

1、mkdir /mnt/cdrom
2   mount /dev/cdrom /mnt/cdrom  #挂着镜像,光盘
3  mkdir /home/redhat-iso
4  cp -Rf /mnt/cdrom/* /home/redhat-iso   #将光盘内的内容copy到某个路径下

cd /etc/yum.repos.d/


touch rhel-media.repo


cat > /etc/yum.repos.d/rhel-media.repo<< EOF
[media]
name=Red Hat Enterprise Linux 6.0                               
baseurl=file:///home/redhat-iso                                        
enabled=1                                                         
gpgcheck=1                                                        
gpgkey=file:///home/redhat-iso/RPM-GPG-KEY-redhat-release  
EOF



yum clean all
yum makecache