关闭

为Red Hat Enterprise Linux Server release 5.5搭建本地YUM源

标签: yum本地源
1483人阅读 评论(0) 收藏 举报
分类:

现状: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文件,成功。


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:231809次
    • 积分:3372
    • 等级:
    • 排名:第9986名
    • 原创:108篇
    • 转载:10篇
    • 译文:7篇
    • 评论:20条
    最新评论