在VMware虚拟机中通过光碟实理本地yum源配置
创建光盘挂载目录
[root@use09 ~]# mkdir /isolinux
配置开机自动挂载
[root@use09 ~]# vim /etc/fstab
[root@use09 ~]# mount -a
[root@use09 ~]# tail -n 1 /etc/fstab
/dev/sr0 /isolinux iso9660 defaults 0 0
创建yum配置文件
[root@use09 ~]# vim /etc/yum.repos.d/base.repo
[root@use09 ~]# cat /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///isolinux
enabled=1
gpgcheck=0
验证效果
[root@use09 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Cleaning repos: base
Cleaning up list of fastest mirrors
Other repos take up 85 M of disk space (use --verbose for details)
[root@use09 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
base | 3.6 kB 00:00:00
(1/2): base/group_gz | 3.5 kB 00:00:00
(2/2): base/primary_db | 798 kB 00:00:00
repo id repo name status
base base 445
repolist: 445
补充
yum clean all 清理缓存
yum repolist 列出可用的yum源