
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir bak
将CentOS-Base.repo CentOS-Debuginfo.repo mv到bak目录下去,这样就可以绕过网络进行本地YUM源安装。
编辑CentOS-Media.repo 配置文件
[root@localhost yum.repos.d]# vi CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. 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=c5-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\\* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media #自定义名称
baseurl=file:///media #本地光盘挂载路径
gpgcheck=0 #检查GPG-KEY,0为不检查,1为检查
enabled=1 #启用YUM源,0为不启用,1为启用
配置完成后执行
[root@localhost yum.repos.d]# yum clean all #清除yum源缓存
[root@localhost yum.repos.d]# yum update #更新yum源
更新完成后就可以通过本地YUM源来安装相应服务了。
