1.先部署yum本地源仓库
[root@localhost ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir backup
[root@localhost yum.repos.d]# mv C* backup/
[root@localhost yum.repos.d]# cp backup/CentOS-Base.repo local.repo
[root@localhost yum.repos.d]# vi local.repo
[centos]
name=centos
baseurl=file:///mnt
gpgcheck=0
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@localhost yum.repos.d]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: centos
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
centos | 3.6 kB 00:00:00
(1/