1.问题

初学Linux,采用边实战nginx边学Linux命令的方式,这样学习的还快还真实一些.当然,问题来的很快.我使用的是redhat,安装pcre就出现了问题,如下:

 [root@localhost ~]# yum install pcre
Loading "security" plugin
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
No Repositories Available to Set Up
Reading repository metadata in from local files
Parsing package install arguments
Setting up repositories
No Repositories Available to Set Up
Reading repository metadata in from local files
No Match for argument: pcre
Nothing to do

从5-6行的描述来看,系统还没有注册RHN.网上查了一下整理到这里,当然你经过本人测试过的.大致过程是重新安装CentOS的yum,卸载Redhat的.好吧,继续

2.解决问题过程

1)查看redhat版本.

不同的redhat版本安装的yum不同,所以在这里需要先知道linux的版本.使用命令

 cat /etc/issue

我的Linux版本为:

 Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Kernel \r on an \m

2)卸载yum.

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

执行后等待,后不会有任何提示,不过可以使用命令

 rpm -qa|grep yum

在卸载前后查看一下yum就可以对比得出,卸载是否有效.

3)安装yum.

从http://mirrors.ustc.edu.cn/centos/(网址可能会发生变化,请网上找最新的版本)找到对应版本的RPM包,进入http://mirrors.ustc.edu.cn/centos/5.1/readme,内容是:

 This directory (and version of CentOS) is depreciated.  For normal users,
you should use // and not /5.1/ in your path. Please see this FAQ
concerning the CentOS release scheme: http://www.centos.org/modules/smartfaq/faq.php?faqid=34 If you know what you are doing, and absolutely want to remain at the 5.1
level, go to http://vault.centos.org/ for packages.

大致的意思是使用centos5的版本即可.根据32位还是64位执行不同的命令下载即可.

CentOS5
32位版的:
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
64位版的:
wget http://mirrors.ustc.edu.cn/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

下载完成,执行结果如下:

 [root@localhost ~]# wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm--23:31:13-- http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm
Resolving mirrors.ustc.edu.cn... 202.141.160.110, :da8:d800:::
Connecting to mirrors.ustc.edu.cn|202.141.160.110|:... connected.
HTTP request sent, awaiting response... OK
Length: (34K) [application/x-redhat-package-manager]
Saving to: `python-iniparse-0.2.-.el5.noarch.rpm' %[==========================================================================>] , 222K/s in .2s :: ( KB/s) - `python-iniparse-0.2.-.el5.noarch.rpm' saved [34330/34330] [root@localhost ~]# wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
--::-- http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
Resolving mirrors.ustc.edu.cn... 202.141.160.110, :da8:d800:::
Connecting to mirrors.ustc.edu.cn|202.141.160.110|:... connected.
HTTP request sent, awaiting response... OK
Length: (1011K) [application/x-redhat-package-manager]
Saving to: `yum-3.2.-.el5.centos.noarch.rpm' %[==========================================================================>] ,, 410K/s in .5s :: ( KB/s) - `yum-3.2.-.el5.centos.noarch.rpm' saved [1034960/1034960] [root@localhost ~]# wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
--::-- http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
Resolving mirrors.ustc.edu.cn... 202.141.160.110, :da8:d800:::
Connecting to mirrors.ustc.edu.cn|202.141.160.110|:... connected.
HTTP request sent, awaiting response... OK
Length: (26K) [application/x-redhat-package-manager]
Saving to: `yum-metadata-parser-1.1.-.el5.i386.rpm' %[==========================================================================>] , 125K/s in .2s :: ( KB/s) - `yum-metadata-parser-1.1.-.el5.i386.rpm' saved [26164/26164] [root@localhost ~]# wget http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm--23:31:25-- http://mirrors.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
Resolving mirrors.ustc.edu.cn... 202.141.160.110, :da8:d800:::
Connecting to mirrors.ustc.edu.cn|202.141.160.110|:... connected.
HTTP request sent, awaiting response... OK
Length: (21K) [application/x-redhat-package-manager]
Saving to: `yum-fastestmirror-1.1.-.el5.centos.noarch.rpm' %[===========================================================================================>] , --.-K/s in .1s :: ( KB/s) - `yum-fastestmirror-1.1.-.el5.centos.noarch.rpm' saved [21033/21033]

安装顺序如下:

 rpm -ivh python-iniparse-0.2.-.el5.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.-.el5.i386.rpm
rpm -ivh yum-3.2.-.el5.centos.noarch.rpm yum-fastestmirror-1.1.-.el5.centos.noarch.rpm

执行结果如下:

 [root@localhost ~]# rpm -ivh python-iniparse-0.2.-.el5.noarch.rpm
warning: python-iniparse-0.2.-.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [%]
:python-iniparse ########################################### [%]
[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.-.el5.i386.rpm
warning: yum-metadata-parser-1.1.-.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [%]
:yum-metadata-parser ########################################### [%]
[root@localhost ~]# rpm -ivh yum-3.2.-.el5.centos.noarch.rpm yum-fastestmirror-1.1.-.el5.centos.noarch.rpm
warning: yum-3.2.-.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [%]
:yum-fastestmirror ########################################### [ %]
:yum ########################################### [%]

4)下载yum配置源.

 mv rhel-debuginfo.repo rhel-debuginfo.repo.bak
cd /etc/yum.repos.d
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

5)生成缓存.

执行命令:

 yum makecache

执行结果:

 Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
addons % |=========================| 1.9 kB :
addons/filelists_db % |=========================| B :
addons/other_db % |=========================| B :
addons/primary_db % |=========================| 1.1 kB :
base % |=========================| 1.1 kB :
base/filelists % |=========================| 3.1 MB :
base/other % |=========================| MB :
base/group % |=========================| 1.1 MB :
base/primary % |=========================| kB :
extras % |=========================| 2.1 kB :
extras/filelists_db % |=========================| kB :
extras/other_db % |=========================| kB :
extras/group % |=========================| 9.7 kB :
extras/primary_db % |=========================| kB :
update % |=========================| 1.9 kB :
update/filelists_db % |=========================| kB :
update/other_db % |=========================| 4.7 MB :
update/primary_db % |=========================| kB :
base /
base /
base /
Metadata Cache Created

完成.

redhat无法注册RHN的解决办法的更多相关文章

  1. 关于C#联接数据库是出现'未在本地计算机上注册'错误的解决办法

    今天在用c#连接access数据库处理数据的时候遇到了一个诡异的问题, 未在本地计算机上注册"Microsoft.ACE.OLEDB.12.0"提供程序 我们的部分代码如下: st ...

  2. Chrome在win8显示“没有注册类”的解决办法

    问题1:从任务栏和桌面快捷方式无法打开Chrome,显示错误为没有注册类问题2:无法从word等中点击打开url,无法打开html,htm方式的文件,同样显示错误为没有注册类出了这两个错误后,用起来相 ...

  3. Redhat中网络启动错误解决办法( Failed to start LSB: Bring up/down networking RTNETLINK answers: File exists)

    关于Redhat系列中网络启动失败的解决办法 报错: Failed to start LSB: Bring up/down networking.             RTNETLINK answ ...

  4. 没有为 COM 互操作注册程序集 请使用 regasm.exe /tlb 注册该程序集——解决办法

    错误现象: 错误 6 没有为 COM 互操作注册程序集“DevExpress.Utils.v13.1, Version=13.1.7.0, Culture=neutral, PublicKeyToke ...

  5. 关于APlayer播放器在打包安装后提示“没有注册类”的解决办法

    1.首先需要确定必要的DLL文件都已经在正确的安装目录下了: 2.项目中引用的DLL必须是Debug目录下的: 3.若后续修改或者重新注册了APlayer组件,那么所有的DLL都需要替换成最新的. 关 ...

  6. Dynamics CRM2013/2015 Plugin注册工具Register New Assembly时无法看到注册按钮的解决办法

    CRM2013的注册插件工具UI相比2011之前有了一定的改变,但改变UI的同时也给开发人员带来了困扰,打开注册工具点击Register按钮选择dll时页面就是下面这样的,你完全看不到最下面的两个按钮 ...

  7. Ctex中WinEdt经常弹出注册小窗口 解决办法

    使用WinEdt 7避免跳出“注册对话框” 在options菜单下点options…,在advanced configuration  =>  Event Handlers  下点Exit, 在 ...

  8. 安装pywin32时,出现找不到python27注册信息的解决办法

    1. 检查一下注册表是否存在python其它版本的信息 方法: 1)在命令行中输入regedit打开注册表 2)在HKEY_CURRENT_USER\Software中找一下是否存在python注册信 ...

  9. RHEL提示RHN没有注册问题的解决方法

    1.系统RHEL5.5,初次使用yum时出现以下问题: [root@localhost real]# yum update Loaded plugins: rhnplugin, security Th ...

随机推荐

  1. cordova屏幕尺寸

    <platform name="android"> <!-- ldpi : 36x36 px mdpi : 48x48 px hdpi : 72x72 px xh ...

  2. 【LeetCode】【动态规划】Generate Parentheses(括号匹配问题)

    描述 Given n pairs of parentheses, write a function to generate all combinations of well-formed parent ...

  3. Python 3 并发编程多进程之进程与线程

    Python 3 进程与线程 进程即正在执行的一个过程.进程是对正在运行程序的一个抽象. 进程的概念起源于操作系统,是操作系统最核心的概念,也是操作系统提供的最古老也是最重要的抽象概念之一.操作系统的 ...

  4. Linux 中 bashrc 中的 rc 是什么意思

    刚刚配置 .bashrc 文件时,突然想,这里面的 rc 是什么意思? 使用了这么长时间,这个都不知道,这是醉了.Google 之,还真有不少人探究过,哈哈. 这个 ubuntu 中文论坛里,有人回答 ...

  5. 算法(Algorithms)第4版 练习 2.1.24

    代码实现: package com.qiusongde; import edu.princeton.cs.algs4.In; import edu.princeton.cs.algs4.StdOut; ...

  6. spring boot拦截器

    实现自定义拦截器只需要3步: 1.创建我们自己的拦截器类并实现 HandlerInterceptor 接口. 2.创建一个Java类继承WebMvcConfigurerAdapter,并重写 addI ...

  7. 学习HTML5

    CSS,层叠样式表,能为网页增添样式的电脑语言. UL属于无序列表 OL属于有序列表 DL属于自定义列表.

  8. HTML5 学习记录——2

    20150826 1.声明文档类型 <!DOCTYPE>  声明HTML是用什么版本写的. 常用声明; 2.HYML头部元素   <head> <title> 定义 ...

  9. MVC中使用showModalDialog

    1.mvc中使用模态对话框用于修改数据,如果第一次修改过后刷新页面,第二次修改时显示内容依然是第一次修改之前的,这里用js中的Math.Random()解决 Views: <%: Html.Ac ...

  10. 0X7FFFFFFF,0X80000000

    给int类型赋值的话,0X7FFFFFFF代表最大值,0X80000000代表最小值 INT_MAX 代表最大值, INT_MIN 代表最小值 #include<iostream> #in ...