[nginx+tomcat的负载均衡搭建] This system is not registered with RHN

在使用RedHat在线安装nginx时提示 “This system is not registered with RHN”,如下所示:

   1: [root@localhost ..]#yum install -y pcre-devel
   2: Loaded plugins: rhnplugin, security
   3: This system is not registered with RHN.
   4: RHN support will be disabled.
   5: Setting up Install Process
   6: No package httpd available.
   7: Nothing to do

从控制台输出的提示中我们可以看出,是系统没有注册的原因。由于我们的redhat没有激活认证,所以我们不能直接使用redhat自带的yum安装一些软件。目前网络上提出了两种解决方案:

第一种:对redhat进行认证激活;

第二种:用centos的yum替换redhat自带的yum。

由于第一种方式需要认证激活才能解决,我们暂时不介绍。下面介绍第二种方式。

1、卸载rhel默认安装的yum包

   1: rpm -qa|grep yum|xargs rpm -e --nodeps

2、下载centos下的yum包

不同版本的操作系统对应不同版本的yum包,如果不知道自己的操作系统版本,可以用以下指令进行查询:

[nginx+tomcat的负载均衡搭建] This system is not registered with RHN

通过 lsb release –a 指令可以查看当前linux的内核版本,本机使用的是6.0;

通过 uname -a 指令可以查看操作系统的版本位数,i686 i386均指32位机器。

(1)选择内核版本

那么根据以上的信息,我们可以查找32位内核为6.0下的yum的版本。这里我们下载的源使用如下地址:

http://ftp.nara.wide.ad.jp/pub/Linux/centos/

访问以上地址,可以打开关于各个内核的列表页面,如下图所示:

[nginx+tomcat的负载均衡搭建] This system is not registered with RHN

从列表中,我们看到有一个6.0版本、一个6版本,这里我们选用6版本,因为官方解释说6.0版本已过期。

 

(2)选择适合的位数

[nginx+tomcat的负载均衡搭建] This system is not registered with RHN

由于我们的机器为32位,所以这里我们选择i386目录

 

(3)下载相应的yum包

    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm  
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpm  
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

3、安装相应的rpm

    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm  
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpm  
    wget http://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
 

4、更改yum源

网络上大部分建议使用网易源,那么我们同样也使用网易的镜像源。

网易镜像源地址为:http://mirrors.163.com/.help/centos.html,按照该页面的向导下载相应的repo文件,这里我们下载的是:http://mirrors.163.com/.help/CentOS6-Base-163.repo,文件下载完毕后,我们打开文件,将$releasever修改为我们的版本号,即6进行保存。

 

[nginx+tomcat的负载均衡搭建] This system is not registered with RHN

 

修改完毕后,运行一下命令,生成缓存:

   1: yum clean all
   2: yum makecache

至此,yum源更换成功。

 

可以再尝试一下开头的安装命令,就可以正常安装了。

上一篇:【jQuery 区别】.click()和$(document).on("click","指定的元素",function(){});的区别


下一篇:Firefox os app 开发实践