广东技术师范学院后院社区's Archiver

2008新生录取咨询

lvdbing 发表于 2008-1-18 08:10

Yum安装本地光盘软件

其实使用本地的光盘做源是很简单的,呵呵,越来越喜欢CentOS 5了。

首先 要先挂载光盘,把光盘挂载到media/CentOS/,media/cdrom/,或者media/cdrecorder/ 这样就不用修改配置文件了。如果想挂载到其他目录,只要修改下baseurl=file:///自己挂载的目录,就可以了。配置文件在 /etc/yum.repos.d/CentOS-Media.repo。

接着 把/etc/yum.repos.d/CentOS-Base.repo改下名,命令如下:
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
检查下配置文件的有没设置正确,命令如下:
#cat /etc/yum.repos.d/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/CentOS/  
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-beta

其实配置文件中已经有教怎么做的了,我好像是多此一举了,0_0。

最后 就是要安装软件咯,命令如下:
#yum --enablerepo=c5-media install gimp
安装你想要的软件。

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.