1: mkdir /rhel_dvd
mount -o loop /mydoc/rhel-5-server-i386-DVD.iso /rhel_dvd
2:rpm -ivh /rhel_dvd/Server/createrepo-0.4.4-2.fc6.noarch.rpm
3:gedit /etc/yum.repos.d/rhel_local.repo
添加内容如下:
[Cluster]
name=Red Hat Enterprise Linux $releasever-$basearch-Cluster
baseurl=file:///rhel_dvd/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:///rhel_dvd/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:///rhel_dvd/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:///rhel_dvd/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
4:执行createrepo命令,为了方便,创建一个sh文件
gedit /root/yum.sh
然后添加内容如下:
#///////////////////////////////
mkdir -p /var/rhel/{Server,Cluster,ClusterStorage,VT}
createrepo -o /var/rhel/Cluster -g /rhel_dvd/Cluster/repodata/comps-rhel5-cluster.xml /rhel_dvd/Cluster
createrepo -o /var/rhel/ClusterStorage -g /rhel_dvd/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /rhel_dvd/ClusterStorage
createrepo -o /var/rhel/Server -g /rhel_dvd/Server/repodata/comps-rhel5-server-core.xml /rhel_dvd/Server
createrepo -o /var/rhel/VT -g /rhel_dvd/VT/repodata/comps-rhel5-vt.xml /rhel_dvd/VT
mount --bind /var/rhel/Cluster/repodata /rhel_dvd/Cluster/repodata
mount --bind /var/rhel/ClusterStorage/repodata /rhel_dvd/ClusterStorage/repodata
mount --bind /var/rhel/Server/repodata /rhel_dvd/Server/repodata
mount --bind /var/rhel/VT/repodata /rhel_dvd/VT/repodata
yum clean all
#//////////////////////////////////////
5:chmod a+x yum.sh
6:./yum.sh
7:3、软件安装测试
1)能够使用yum下载安装软件。
例如,使用以下命令会下载安装bind、bind-chroot软件包(自动查找解决依赖关系):
[root@localhost ~]# yum install bind-chroot
2)使用system-config-packages“添加删除程序”(在X-Window环境)。
应该能够浏览并安装集群、集群存储、虚拟化……等各项软件包。……
阅读(533) | 评论(0) | 转发(0) |