配置挂载点,挂载本地镜像

mkdir /mnt
mount -o loop /dev/sr0 /mnt

配置yum文件

cd /etc/yum.repo.d/
vi redhat-base.repo
[local]
name=Red Hat Enterprise Linux 7.9
baseurl=file:///mnt
enabled=1
gpgcheck=0