掛載光驅vim
[root@yanjin ~]# mount /dev/cdrom /media/ide
修改yum配置文件測試
[root@yanjin ~]# vim /etc/yum.repos.d/CentOS6-Base-163.repourl
[c6-media]it
name=CentOS-$releasever - Mediaclass
baseurl=file:///media/gcc
gpgcheck=1配置
enabled=0file
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6gc
測試
[root@yanjin ~]# yum --disablerepo=\* --enablerepo=c6-media search gcc