mkdir -p /tmp/yum
mv /etc/yum.repos.d/* /tmp/yum
mkdir -p /media/cdrom
mount /dev/cdrom /media/cdrom
df -Th
生成yum配置
cat << EOF >> /etc/yum.repos.d/rhel8.repo
[BaseOS]
name=BaseOS
baseurl=file:///media/cdrom/BaseOS
enabled=1
gpgcheck=0
[Appstream]
name=AppStream
baseurl=file:///media/cdrom/AppStream
enabled=1
gpgcheck=0
EOF
设置开机挂载
echo '/dev/sr0 /media/cdrom iso9660 defaults 0 0' >> /etc/fstab
生成yum源
yum makecache
yum repolist all
df -Th
测试本地安装
yum -y install httpd
yum -y remove httpd