在某些情況下,如果希望將光碟內容直接讓Package Manager存取,可透過以下方式:
(原文出處:http://www.php-oa.com/2007/12/23/yum-cdrom-centos/)
(此方法需要DVD諜,如果是光碟請全部拷貝入硬碟內)
(原文出處:http://www.php-oa.com/2007/12/23/yum-cdrom-centos/)
(此方法需要DVD諜,如果是光碟請全部拷貝入硬碟內)
- mount -o loop rhel-5-server-dvd.iso /media/rhel
- vi /etc/yum.repos.d/rhel-local.repo
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=file:///var/rhel/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=file:///var/rhel/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:///var/rhel/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=file:///var/rhel/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
- mkdir -p /var/rhel/{Cluster,ClusterStorage,Server,VT}
- 此步驟需要第三方軟體createrepo,請到http://dag.wieers.com/rpm/packages/createrepo/ 下載。
createrepo -o /var/rhel/Cluster -g /media/rhel/Cluster/repodata/comps-rhel5-cluster.xml /media/rhel/Cluster
createrepo -o /var/rhel/ClusterStorage -g /media/rhel/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /media/rhel/ClusterStorage
createrepo -o /var/rhel/Server -g /media/rhel/Server/repodata/comps-rhel5-server-core.xml /media/rhel/Server
createrepo -o /var/rhel/VT -g /media/rhel/VT/repodata/comps-rhel5-vt.xml /media/rhel/VT
- mount --bind /var/rhel/Cluster/repodata /media/rhel/Cluster/repodata
mount --bind /var/rhel/ClusterStorage/repodata /media/rhel/ClusterStorage/repodata
mount --bind /var/rhel/Server/repodata /media/rhel/Server/repodata
mount --bind /var/rhel/VT/repodata /media/rhel/VT/repodata
- yum clean all
- 接下來,啟動Package Manager,就可以存取內容了。
沒有留言:
張貼留言