现在的位置: 首页 > 综合 > 正文

CentOS 6 修改yum源为本地光盘

2013年08月14日 ⁄ 综合 ⁄ 共 835字 ⁄ 字号 评论关闭

yum源主要分为网络和光盘。配置文件存放在/etc/yum.repo.d目录中

cat 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]
 
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///mnt/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

代表yum会搜索/media/CentOS/、/mnt/cdrom/、/media/cdrecorder/三个目录查找。

插入光盘后meida目录下回显示你的光盘名,但是不是上述几个目录,可以使用ln来完成

ln -s /media/光盘名 /meida/CentOS

如果是使用本地的ISO文件。

mkdir /media/CentOS

mount -o loop 光盘.ISO /media/CentOS

 

配置完成后就可以更新软件了

yum --disablerepo=* --enablerepo=c6-media install   ****

来完成软件的更新

抱歉!评论已关闭.