配置YUM源
1、查看CD设备是否连接,右击打开快捷菜单,选择“设置”;(或右击打开快捷菜单,选择“可移动设备”>“CD/DVD(IDE)”>“连接”命令)
将CD设备挂载到/opt/centos目录下,命令如下;
[root@localhost ~]# mkdir /opt/centos
[root@localhost ~]# mount /dev/cdrom /opt/centos/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# ll /opt/centos/
total 636
-r--r--r--. 1 root root 14 Dec 9 2015 CentOS_BuildTag
dr-xr-xr-x. 3 root root 2048 Dec 9 2015 EFI
-r--r--r--. 1 root root 215 Dec 9 2015 EULA
-r--r--r--. 1 root root 18009 Dec 9 2015 GPL
dr-xr-xr-x. 3 root root 2048 Dec 9 2015 images
dr-xr-xr-x. 2 root root 2048 Dec 9 2015 isolinux
dr-xr-xr-x. 2 root root 2048 Dec 9 2015 LiveOS
dr-xr-xr-x. 2 root root 612352 Dec 9 2015 Packages
dr-xr-xr-x. 2 root root 4096 Dec 9 2015 repodata
-r--r--r--. 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-7
-r--r--r--. 1 root root 1690 Dec 9 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Dec 9 2015 TRANS.TBL
2、配置本地YUM源文件,先将/etc/yum.repos.d/下的文件移走,然后创建local.repo文件,命令如下:
[root@localhost ~]# mv /etc/yum.repos.d/* /media/
[root@localhost ~]# vi /etc/yum.repos.d/local.repo
[root@localhost ~]# cat /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
至此,YUM源配置完毕。