使用yum安装本地光盘里的软件

2008年9月9日 | 11:40分类:linux | 标签: | 211 views

首先 要先挂载光盘,把光盘挂载到media/CentOS/,media/cdrom/,或者media/cdrecorder/

使用mount -o loop /home/disk1/os/centos/CentOS-5.2-i386-bin-DVD.iso /media/CentOS/挂载光盘

这样就不用修改配置文件了。如果想挂载到其他目录,只要修改下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

最后 就是要安装软件咯,命令如下:

#yum --enablerepo=c5-media install gimp

安装你想要的软件。

发表您的评论

您的名字: (*必填)

您的邮箱: (*不会被公布 ,必填)

您的网站:

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word