首页 > 其他 > 详细

Centos

时间:2014-04-18 19:27:31      阅读:570      评论:0      收藏:0      [点我收藏+]

CentOS-Base.repo 是yum 网络源的配置文件,CentOS-Media.repo 是yum 本地源的配置文件
禁用默认的yum 网络源,将yum 网络源配置文件改名为CentOS-Base.repo.bak,否则会先在网络源中寻找适合的包,改名之后直接从本地源读取。

##挂载并修改repo文件

bubuko.com,布布扣
mkdir /mnt/yum_source/
mount -o rw,remount /export/jiangxu/CentOS-6.3-x86_64-bin-DVD1.iso  /mnt/yum_source -o loop ##挂载并可读写

echo "
[software]
name=software
baseurl=file:///mnt/yum_source
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6" > /etc/yum.repos.d/yumsource_local.repo

echo " 
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  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:///media/CentOS/
#        file:///media/cdrom/
#        file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
baseurl=file:///mnt/yum_source" > /etc/yum.repos.d/CentOS-Media.repo
View Code

##清缓存并测试

bubuko.com,布布扣
yum clean all
yum install -y dos2unix
bubuko.com,布布扣

 

 

 

 

Centos,布布扣,bubuko.com

Centos

原文:http://www.cnblogs.com/jiangxu67/p/3672628.html

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