redhat7 yum安装软件时提示This system is not registered with RHN. 解决方案

阅读更多
在使用redhat7的yum命令安装软件时,发现总是提示This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 或如下错误信息:This system is not registered with RHN. RHN support will be disabled.原来RHEL7的yum服务是付费的,因为没有付费,所以无法使用yum安装软件,只能替换为CentOs的yum工具,下面是具体操作步骤。

-- 查看yum
rpm -qa |grep yum

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

--拷贝centos系统yum工具安装程序到linux指定目录下
yum-3.4.3-132.el7.centos.0.1.noarch.rpm
yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
yum-updateonboot-1.1.31-34.el7.noarch.rpm
yum-utils-1.1.31-34.el7.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
安装程序见附件

--安装yum包
rpm -ivh yum-*
--导入key(记不清需要不需要了)
rpm --import public.gpg.key
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

--在阿里云开源软件镜像站点下载资源文件,目标地址是/etc/yum.repos.d/CentOS-Base.repo(覆盖写)
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

--替换CentOS-Base.repo文件$releasever变量为相关linux版本,这里替换为“7”就可以了,具体操作:
vi /etc/yum.repos.d/CentOS-Base.repo
:%s/$releasever/7/ge
:wq

使用yum下载安装软件就ok了,如下提示已经开始从阿里云镜像服务器下载软件了。
# yum install -y telnet
已加载插件:fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
base                                                                                                                                                                    | 3.6 kB  00:00:00    
extras                                                                                                                                                                  | 3.4 kB  00:00:00    
updates                                                                                                                                                                 | 3.4 kB  00:00:00    
(1/4): base/x86_64/group_gz                                                                                                                                             | 155 kB  00:00:00    
(2/4): extras/x86_64/primary_db                                                                                                                                         | 101 kB  00:00:00    
(3/4): updates/x86_64/primary_db                                                                                                                                        | 3.1 MB  00:00:02    
base/x86_64/primary_db         FAILED                                         
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/c6411f1cc8a000ed2b651b49134631d279abba1ec1f78e5dcca79a52d8c1eada-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
(4/4): base/x86_64/primary_db                                                                                                                                           | 5.3 MB  00:00:03    
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 telnet.x86_64.1.0.17-59.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

===============================================================================================================================================================================================
Package                                     架构                                        版本                                                  源                                         大小
===============================================================================================================================================================================================
正在安装:
telnet                                      x86_64                                      1:0.17-59.el7                                         base                                       63 k

事务概要
===============================================================================================================================================================================================
安装  1 软件包

总下载量:63 k
安装大小:113 k
  • yum.rar (1.3 MB)
  • 下载次数: 233

你可能感兴趣的:(RedHat)