切换目录
[root@localhost ~]# cd /etc/yum.repos.d/
挂载镜像
[root@localhost yum.repos.d]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
编写yum源仓库
[root@localhost ~]# vim /etc/yum.repos.d/base.repo
里面的内容
[base]
name=base
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
查看yum的文件
[root@localhost yum.repos.d]# ll
总用量 8
-rw-r–r--. 1 root root 133 4月 22 01:03 base.repo
-rw-r–r--. 1 root root 358 4月 22 01:03 redhat.repo
安装httpd
[root@localhost yum.repos.d]# dnf install httpd -y
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.
base 54 MB/s |