1、挂载iso镜像到/mnt
2、修改/etc/yum.repos.d/下面的repo文件,修改为如下:
[baseos] name=CentOS Linux $releasever - baseOS #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=baseOS&infra=$infra #baseurl=http://mirror.centos.org/$contentdir/$releasever/baseOS/$basearch/os/ baseurl=file:///mnt/baseOS gpgcheck=0 enabled=1 [appstream] name=CentOS Linux $releasever - AppStream #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra #baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ baseurl=file:///mnt/AppStream gpgcheck=0 enabled=1 #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial



