1、首先掛載光盤
設備-分配光驅-Choose a virtual CD/DVD disk file 選擇DVD鏡像,此時鏡像被自動加載到
/media/RHEL_5.4 x86_64 DVD
2、新建/etc/yum.repos.d/dvd.repo,添加如下內容並保存
[base]
name=Server
baseurl=file:///media/RHEL_5.4%20x86_64%20DVD/Server
enable=1
gpcheck=1
gpgkey=file:///media/RHEL_5.4%20x86_64%20DVD/RPM-GPG-KEY-RedHat-release
注:由於文件路徑中有空格,所以需要將其轉義成%20
如果還需要安裝關於cluster、clusterstorage或者xen相關的軟件包,只須再添加以下內容:
[VT]
name=VT
baseurl=file:///media/RHEL_5.4%20x86_64%20DVD/VT
enable=1
gpcheck=1
gpgkey=file:///media/RHEL_5.4%20x86_64%20DVD/RPM-GPG-KEY-redhat-release
[Cluster]
name=Cluster
baseurl=file:///media/RHEL_5.4%20x86_64%20DVD/Cluster
enable=1
gpcheck=1
gpgkey=file:///media/RHEL_5.4%20x86_64%20DVD/RPM-GPG-KEY-redhat-release
[CS]
name=ClusterStorage
baseurl=file:///media/RHEL_5.4%20x86_64%20DVD/ClusterStorage
enable=1
gpcheck=1
gpgkey=file:///media/RHEL_5.4%20x86_64%20DVD/RPM-GPG-KEY-redhat-release
3、清空yum緩存配置,使新路徑生效
至此配置完成,yum就可以使用了,不過下次使用的時候記得加載光盤或者設置為開機自動加載。