Centos光盘做yum源
命令:
mount /dev/cdrom /media/cdrom
如果想挂载到其他目录,只要修改下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
检查下配置文件的有没设置正确,命令如下:
# 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/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
最后就是开机执行自动挂载光盘
echo "/dev/cdrom /media/cdrom auto exec 0 0" >> /etc/fstab
本文出自 蓝鹰博客,转载时请注明出处及相应链接。
本文永久链接: http://www.lanyingblog.com/blog/1833.html