#列出软件仓库的配置文件[root@localhost yum.repos.d]# cd /etc/yum.repos.d[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-Media.repo CentOS-x86_64-kernel.repo
CentOS-Debuginfo.repo CentOS-Sources.repo
[root@localhost yum.repos.d]# cat CentOS-Media.repo# CentOS-Media.repo## This repo can be used with mounted DVD media, verify the mount point for# CentOS-7. You can use this repo and yum to install items directly off the# DVD ISO that we release.## To use this repo, put in your DVD and use it with the other repos too:# yum --enablerepo=c7-media [command]# # or for ONLY the media repo, do this:## yum --disablerepo=\* --enablerepo=c7-media [command]#作为配置文件local.repo模板[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@localhost yum.repos.d]# cp CentOS-Media.repo /root/local.repo