将 iso 文件挂载到 /mnt/rhiso 作为 yum 目标
# mkdir -p /mnt/rhiso
# mount -o loop RHELX-XXXX.iso /mnt/rhiso
如果使用 DVD,请将 DVD 放入 cdrom 并将 DVD 挂载到 /mnt/rhiso 作为 yum 目标
# mkdir -p /mnt/rhiso
# mount /dev/cdrom /mnt/rhiso
创建一个yum repo文件,/etc/yum.repos.d/dvd.repo在服务器上:
# vi /etc/yum.repos.d/BaseOS.repo
[BaseOS]
name=Red Hat Enterprise Linux 8.0 BaseOS
baseurl=file:///mnt/rhiso/BaseOS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
# vi /etc/yum.repos.d/AppStream.repo
[AppStream]
name=Red Hat Enterprise Linux 8.0 AppStream
baseurl=file:///mnt/rhiso/AppStream/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清理现有的yum/dnf cache并在客户端获取更新的存储库列表
# dnf clean all
# rm -rf /var/cache/dnf/*
# dnf makecache
# dnf repolist