1.在vmware里加载光盘
打开控制台
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
mkdir /yum
cp -avf /mnt/cdrom /yum

2.配置/etc/yum.repos.d/
cp -r /etc/yum.repos.d /etc/yum.repos.d.bak
cd /etc/yum.repos.d
rm -rf /etc/yum.repos.d/* #别误删,注意该命令
vi Centos-Local.repo
[Local]
name = Local yum
baseurl=file:///yum/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1