如何挂载 CentOS 7 ISO 并将其添加为 yum 存储库

act*_*cay 3 repository centos7

如何挂载 CentOS 7 ISO 并将其添加为 yum 存储库?

我搜索的地方说要media.repo在安装的 ISO 下寻找一个,但没有这样的文件。

Mic*_*ton 7

repo 文件已经存在于你安装的 CentOS 系统上,作为/etc/yum.repos.d/CentOS-Media.repo.

[root@localhost ~]# cat /etc/yum.repos.d/CentOS-Media.repo 
# CentOS-Media.repo
#
#  This repo can be used with mounted DVD media, verify the mount point for
#  CentOS-7.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c7-media [command]
#  
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c7-media [command]

[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Run Code Online (Sandbox Code Playgroud)

在给定位置之一挂载 ISO 映像,或适当修改文件,然后按照说明启用它。