redhat 6 yum 安装

使用redhat 系统在线安装时提示This system is not registered with RHN.如下:

[root@localhost ~]# yum install httpd
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package httpd available.
Nothing to do
解决方案:

1.卸载redhat自带的yum组件

[root@hadoop-data ~]# rpm -qa|grep yum|xargs rpm -e --nodeps

2.安装centos的yum包

[root@hadoop-data ~]# wget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
[root@hadoop-data ~]# wget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[root@hadoop-data ~]# wget http://centos.ustc.edu.cn/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
[root@hadoop-data ~]# mv yum-*.rpm /tars/

[root@hadoop-data ~]# cd /tars/

[root@hadoop-data tars]# rpm -ivh yum-*.rpm
warning: yum-3.2.29-40.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [ 33%]
   2:yum-plugin-fastestmirro########################################### [ 67%]

[root@hadoop-data tars]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
--2013-03-26 18:28:11-- http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

3. 下载更新源,并存放在系统目录中
[root@hadoop-data ~]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

[root@hadoop-data ~]#mv CentOS_Base.repo /etc/yum.repos.d/CentOS-Base.repo

此文件的CentOS 5 的版本,修改其中的配置为版本6,并删除 addons 项,因为在版本6中没有此源

也没有找到版本6对应的repo文件,万幸它的目录整体结构没有变, 仍然可以使用!

4.生成缓存并进行安装

[root@hadoop-data ~]# yum makecache
[root@hadoop-data ~]# yum install httpd

猜你喜欢

转载自xjward.iteye.com/blog/1837074