首页 > 其他 > 详细

CentOS配置本地YUM源

时间:2014-09-25 16:15:18      阅读:241      评论:0      收藏:0      [点我收藏+]

1.放入Centos的镜像光盘或找到镜像文件,然后挂载到系统中

mount /dev/cdrom /mnt/cdrom  #/mnt/cdrom目录要先创建好

 

2.cd /etc/yum.repos.d/ #进入/etc/yum.repos.d/目录

 

3.mkdir bak

并将CentOS-Base.repo 和  CentOS-Debuginfo.repo 移动到到bak目录下去,这样就可以绕过网络进行本地YUM源安装

 

4.编辑CentOS-Media.repo 配置文件

 

# CentOS-Media.repo  
#  
#  This repo can be used with mounted DVD media, verify the mount point for  
#  CentOS-6.  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=c6-media [command]  
#  
# or for ONLY the media repo, do this:  
#  
#  yum --disablerepo=\* --enablerepo=c6-media [command]  
   
[c6-media]  
name=CentOS-$releasever - Media #自定义名称  
baseurl=file:///mnt/cdrom   #本地光盘挂载路径  
gpgcheck=0  #检查GPG-KEY,0为不检查,1为检查  
enabled=1   #启用YUM源,0为不启用,1为启用 

 

4.配置完成后执行

 

yum clean all #清除yum源缓存

 

yum update #更新yum源

 

更新完成后就可以通过本地YUM源来安装相应服务了。

 

5.测试:

yum install gcc-c++ #查看是否成功

 

CentOS配置本地YUM源

原文:http://www.cnblogs.com/googleyao/p/3992942.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!