mount -t auto /dev/cdrom /media --mount光驱,挂载点media vi /etc/yum.repo.d/media.repo --新建一个yum配置文件,指定yum库位置 [Server] name=Red Hat Enterprise Linux $releasever Server --自定义 baseurl=file:///media/Server/ --光盘中repodata目录路径 enabled=1 --是否启用,1启用,0禁用 gpgcheck=0 --是否校验,1启用,0禁用
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