前提:rhel-8.0-x86_64-dvd.iso镜像已经在光驱里。
1、创建临时挂载目录
[root@laofuxi.com ~]# mkdir /mnt/cdrom
2、挂载光驱
[root@laofuxi.com ~]# mount /dev/cdrom /mnt/cdrom/
3、安装autofs
[root@laofuxi.com ~]# yum -y localinstall /mnt/cdrom/BaseOS/Packages/autofs-5.1.4-29.el8.x86_64.rpm
4、卸载光驱
[root@laofuxi.com ~]# umount /dev/cdrom
5、将autofs.service添加到开机启动服务
[root@laofuxi.com ~]# systemctl enable autofs.service
6、重启autofs.service服务
[root@laofuxi.com ~]# systemctl restart autofs.service
7、创建光盘yum源配置文件
[root@laofuxi.com ~]# cat<< EOF > /etc/yum.repos.d/dvd.repo [dvd-BaseOS] name=RHEL 8.0 ISO BaseOS baseurl=file:///misc/cd/BaseOS enabled=1 gpgcheck=0 [dvd-AppStream] name=RHEL 8.0 ISO AppStream baseurl=file:///misc/cd/AppStream enabled=1 gpgcheck=0 EOF
8、生成元数据缓存
[root@laofuxi.com ~]# yum makecache
完成。
- 本文固定链接: https://www.laofuxi.com/1111.html
- 转载请注明: 劳福喜 于 劳福喜-专注Linux服务器运维技术 发表