1,进入对应文件 cd /etc/yum.repos.d/ 如下图操作 注意CentOS-Base.repo.bak 是必须以 .bak结尾 不然出错
[root@localhost cdrom]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo.bak CentOS-Media.repo
CentOS-Debuginfo.repo CentOS-Vault.repo
CentOS-fasttrack.repo
[root@localhost yum.repos.d]# vim CentOS-Media.repo
2,把要修改的pgcheck=0(默认) 改为pgcheck=1 即可 如下图
1 # CentOS-Media.repo
2 #
3 # This repo can be used with mounted DVD media, verify the mount point for
4 # CentOS-6. You can use this repo and yum to install items directly off the
5 # DVD ISO that we release.
6 #
7 # To use this repo, put in your DVD and use it with the other repos too:
8 # yum --enablerepo=c6-media [command]
9 #
10 # or for ONLY the media repo, do this:
11 #
12 # yum --disablerepo=* --enablerepo=c6-media [command]
13
14 [c6-media]
15 name=CentOS-$releasever - Media
16 baseurl=file:///mnt/cdrom/
17 gpgcheck=1
18 enabled=1
19 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6