1、创建文件local.repo

   

# cat /etc/yum.repos.d/local.repo[rhel-source]name=Red Hat Enterprise Linux LOCAL YUMbaseurl=file:///media/Serverenabled=1gpgcheck=1#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releasegpgkey=file:///media/RPM-GPG-KEY-redhat-release

2、把光盘挂载到/media目录下

   # mount /dev/cdrom /media/

   mount: block device /dev/sr0 is write-protected, mounting read-only

3、清除yum缓存文件

   # yum clean all

   Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

   Updating certificate-based repositories.

   Repository rhel-source is listed more than once in the configuration

   Cleaning repos: rhel-source

   Cleaning up Everything

4、然后就可以用yum进行安装了