現狀:Red Hat Enterprise Linux Server release 5.5上可以使用YUM,但是需要到紅帽官方注冊,需要花錢。
不花錢的方法:在局域網一台機器上為Red Hat Enterprise Linux Server release 5.5搭建一個YUM源,然後供局域網中的其他機器使用。
yum源搭建 的詳細流程:
1 在A機器(CentOS release 6.4 (Final)系統)安裝JDK、Tomcat、createrepo
createrepo安裝命令:yum install -y createrepo*
2 將Red Hat Enterprise Linux Server release 5.5 ISO文件上傳到A機器上/home/commonsoft/,並掛載到os文件夾中
掛載命令:mount -t iso9660 -o loop rhel-server-5.5-x86_64-dvd.iso os
3 在/home/commonsoft/apache-tomcat-7.0.42/webapps/下面創建兩個文件夾
mkdir rehl rehl1
4 將os文件夾中的東西全部COPY到rehl rehl1 各一份,然後刪除rehl中所有的.html文件,刪除rehl/Server/repodata/*、rehl/ServerStrorage/repodata/*、rehl/Cluster/repodata/*、rehl/VT/repodata/*
5 建立rpm文件間的關系
createrepo -s sha -g /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl1/Server/repodata/comps-rhel5-server-core.xml /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl/Server/
createrepo -s sha -g /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl1/Cluster/repodata/comps-rhel5-cluster.xml /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl/Cluster/
createrepo -s sha -g /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl1/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl/ClusterStorage/
createrepo -s sha -g /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl1/VT/repodata/comps-rhel5-vt.xml /home/commonsoft/apache-tomcat-7.0.42/webapps/rehl/VT/
6 創建rehl-5p5.repo文件,文件內容如下:
[rehl-server]
name = rehl-server
baseurl = http://archive.cloudera.com/rehl/Server
gpgkey = http://archive.cloudera.com/rehl/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[rehl-cluster]
name = rehl-cluster
baseurl = http://archive.cloudera.com/rehl/Cluster
gpgkey = http://archive.cloudera.com/rehl/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[rehl-clusterStorage]
name = rehl-clusterStorage
baseurl = http://archive.cloudera.com/rehl/ClusterStorage
gpgkey = http://archive.cloudera.com/rehl/RPM-GPG-KEY-redhat-release
gpgcheck = 1
[rehl-vt]
name = rehl-vt
baseurl = http://archive.cloudera.com/rehl/VT
gpgkey = http://archive.cloudera.com/rehl/RPM-GPG-KEY-redhat-release
gpgcheck = 1
7 將rehl-5p5.repo上傳到B機器(Red Hat Enterprise Linux Server release 5.5系統)/etc/yum.repos.d並把xxx.xxx.xxx.xxx archive.cloudera.com寫入B的/etc/hosts(可以先將別的沒法使用的源刪除)
8 在B上執行yum clean all
9 在B上執行yum list available,結果列出很多rpm文件,成功。