#yum-config-manager --disable \*
--屏弊所有更新源
#mkdir /r7iso
# cd /run/media/{用户名}/CentOS\ 7\ x86_64/
#cp -rf * /r7iso/
--将光盘所有的包拷到本地
#createrepo --database /mnt/local_repo
--创建仓库
#/etc/yum.repos.d/CentOS-Base.repo
--修改如下:
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=file:///r7iso/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7