挂在本地镜像到 mnt目录下
mount /dev/sr0 /mnt
mount 查看是否挂在成功
cd /etc/yum.repos.d
cp rhel-source.repo rhel-localhost.repo
vim rhel-localhost.repo
[rhel-localhost]
name=localhostyum
baseurl=file:///mnt/
enable=1
gpgcheck=0
保存退出
yum clean all
yum repolist
开机自动挂载
vim /etc/rc.d/rc.locat
#末尾添加
mount /dev/sr0 /mnt/