忘記轉載哪裏了
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