To mount the image first, I mount the path to/mnt
Then we'll start entering.
Cd/etc/yum.repos.d
Back up all the files first, so that you don't find them when you use them later.
Then delete all the source files
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-debuginfo.repo Centos-vault.repo
Centos-base.repo.bak Centos-sources.repo
[Email protected] yum.repos.d]# MV Centos-debuginfo.repo Centos-debuginfo.repo.bak
[Email protected] yum.repos.d]# MV Centos-vault.repo Centos-vault.repo.bak
[Email protected] yum.repos.d]# MV Centos-sources.repo Centos-sources.repo.bak
[Email protected] yum.repos.d]# RM-RF Centos-sources.repo Centos-debuginfo.repocentos-base.repo
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-sources.repo.bak
Centos-base.repo.bak Centos-vault.repo.bak
Centos-debuginfo.repo.bak
[Email protected] yum.repos.d]# rm-f Centos-base.repo
[Email protected] yum.repos.d]#
[Email protected] yum.repos.d]#
Create a new file and write the contents
[Email protected] yum.repos.d]# vim Centos-media.repo
[C7-media]
name=centos-$releasever-media
Baseurl=file:///mnt
Gpgcheck=0
Enabled=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7
Next can install the service, do not need the network.
This article is from the "Pengjiawang" blog, make sure to keep this source http://pengjiawang.blog.51cto.com/10989721/1866956
CentOS 7.0 uses mirrored local Yum