首先將光盤放進光驅裏。 vim
第一步:#mountide
查看光盤掛載在哪一個地方。例如 個人是/dev/hdc。url
#mount -t /dev/hdc /mnt/rhelspa
第二步:建立repo文件server
#vim /etc/yum.repos.d/rhel-local.repoxml
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=file:///mnt/rhel/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releaseit
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=file:///mnt/rhel/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releaseclass
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=file:///mnt/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:///mnt/rhel/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releasefile
第三步:
#mkdir -p /var/rhel/{Cluster,ClusterStorage,Server,VT}
第四步:安裝createrepo命令。
#cd /mnt/rhel/Server/
# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
第五步:重建comps-rhel5-*.xml文件
#createrepo -o /var/rhel/Cluster -g /mnt/rhel/Cluster/repodata/comps-rhel5-cluster.xml /mnt/rhel/Cluster
#createrepo -o /var/rhel/ClusterStorage -g /mnt/rhel/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /mnt/rhel/ClusterStorage
#createrepo -o /var/rhel/Server -g /mnt/rhel/Server/repodata/comps-rhel5-server-core.xml /mnt/rhel/Server
#createrepo -o /var/rhel/VT -g /mnt/rhel/VT/repodata/comps-rhel5-vt.xml /mnt/rhel/VT
這樣就爲這幾個目錄生成了頭文件信息
第六步:
#yum clean all
其實只作紅色部分的就能夠了。其它是虛擬化和集羣用的。能夠不用加入。