1. Mount the disc
[[email protected] ~]# Mount/dev/cdrom/media/cdrom/mount:/dev/sr0 write protection, will be mounted as read-only
The CDROM directory under/media is created in advance.
2. Modify Yum configuration file (file location:/ETC/YUM.REPOS.D)
[Email protected]/]# cd/etc/yum.repos.d/[[email protected] yum.repos.d]# mkdir bak #创建一个文件夹来存放多余的配置文件 [[Email Protect ED] yum.repos.d]# MV * * bak/[[email protected] yum.repos.d]# CD Bak/[[email protected] bak]# lscentos-base.repo
centos-debuginfo.repo centos-media.repo centos-vault.repocentos-cr.repo Centos-fasttrack.repo
# centos-media.repo## This repo can is used with mounted DVD Media, verify the mount point for# CentOS-7. You can use the this repo and the Yum to install items directly off the# DVD ISO then we release.## to use this repo, put in Y Our DVDs and use it with the other repos too:# yum--enablerepo=c7-media [command]## or for-the media repo, do thi s:## yum--disablerepo=\*--enablerepo=c7-media [command][c7-media]name=centos-$releasever-mediabaseurl=file :///media/centos/ file:///media/cdrom/#本地yum源所在路径 file:///media/cdrecorder/gpgcheck=0 # Here for 0 do not check enabled=1 #这里为1 start gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7~
Save exit
3. Verification
We can view the warehouse with the Yum command plus the list parameter
[email protected]/]# Yum list
How Linux builds local yum warehouses by mounting the system CD