首先 要先挂载光盘,把光盘挂载到media/CentOS/,media/cdrom/,或者media/cdrecorder/ 这样就不用修改配置文件了。如果想挂载到其他目录,只要修改下baseurl=file:///自己挂载的目录,就可以了。配置文件在 /etc/yum.repos.d/CentOS-Media.repo。
接着 把/etc/yum.repos.d/CentOS-Base.repo改下名,命令如下:
QUOTE: |
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak |
检查下配置文件的有没设置正确,命令如下:
QUOTE: |
#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 to # 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
安装你想要的软件。