1、确认光驱连接
[root@localhost ~]# # lsblk | grep rom
sr0 11:0 1 7.9G 0 rom /mnt/cdrom
[root@localhost ~]# # mkdir /mnt/cdrom
[root@localhost ~]# # vim /etc/fstab
...
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
[root@localhost ~]# # mount -a
[root@localhost ~]# # echo $?
[root@localhost ~]# ls /mnt/cdrom/
AppStream extra_files.json media.repo
BaseOS GPL RPM-GPG-KEY-redhat-beta
EFI images RPM-GPG-KEY-redhat-release
EULA isolinux TRANS.TBL
2、安装yum-utils
[root@localhost ~]# ls /mnt/cdrom/BaseOS/Packages/yum-utils-4.0.12-3.el8.noarch.rpm
/mnt/cdrom/BaseOS/Packages/yum-utils-4.0.12-3.el8.noarch.rpm
[root@localhost ~]# yum install /mnt/cdrom/BaseOS/Packages/yum-utils-4.0.12-3.el8.noarch.rpm
3、添加两个软件仓库
[root@localhost ~]# yum-config-manager --add file:///mnt/cdrom/BaseOS/
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Adding repo from: file:///mnt/cdrom/BaseOS/
[root@localhost ~]# yum-config-manager --add file:///mnt/cdrom/AppStream/
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Adding repo from: file:///mnt/cdrom/AppStream/
[root@localhost ~]#
4、导入公钥
[root@localhost ~]# rpm --import /mnt/cdrom/RPM-GPG-KEY-redhat-release
[root@localhost ~]# rpm -qa | grep pub
5、使用
# yum -y install ftp