将镜像挂载[[email protected] ~]# cd /mnt
[[email protected] mnt]# mkdir /mnt/cdrom
[[email protected] mnt]# mount -t iso9660 /dev/cdrom /mnt/cdrom
将镜像内的文件拷贝到本地[[email protected] ~]# mkdir /opt/localbase
[[email protected] ~]# cp -r /mnt/cdrom/* /opt/localbase/
在/etc/yum.repos.d 创建 local.repo 源文件[[email protected] ~]# touch /etc/yum.repos.d/local.repo
[[email protected] ~]# vim /etc/yum.repos.d/local.repo
[rhel64] #这是库名称
baseurl= #存放源的地址
gpgcheck=0 #检查GPG-KEY,0为不检查,1为检查
enabled=1 #是否用该yum源,0为禁用,1为使用
name=rhel64 #库名称的描述
测试yum是否配置成功
清理yum缓存[[email protected] ~]# yum clean all