yum 失败(This system is not registered with RHN.)解决

使用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@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps

2.安装centos的yum包

[root@localhost ~]# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
[root@localhost ~]# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
[root@localhost ~]# wget  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
[root@localhost ~]# rpm -ivh *.rpm
warning: yum-3.2.22-37.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [ 33%]
   2:yum-fastestmirror      ########################################### [ 67%]
   3:yum                    ########################################### [100%]

 

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

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

 

4.生成缓存并进行安装

[root@localhost ~]# yum makecache
[root@localhost ~]# yum install httpd

这个提示信息表明你的系统没有与授权服务器注册,无法访问订阅服务。要解决这个问题,你可以按照以下步骤使用subscription-manager命令行工具来注册: 1. **打开终端**:首先,你需要打开终端或者命令提示符(取决于你的操作系统,如Linux中的`Ctrl+Alt+T`,或Windows中的`Win + R`然后输入`cmd`)。 2. **更新包列表**:确保你已经安装了subscription-manager,如果还没有,可以通过运行 `sudo yum install subscription-manager` (如果是Fedora或RHEL) 或 `sudo apt-get install subscription-manager` (如果是Ubuntu或Debian) 来安装。 3. **运行注册命令**:接着,输入以下命令来注册你的系统: ``` sudo subscription-manager register --username=你的用户名 --password=你的密码 --auto accept-eula ``` 请将`你的用户名`和`你的密码`替换为你的Red Hat Network (RHN) 或类似的订阅管理账户的用户名和密码。 4. **验证注册**:如果注册成功,系统会显示一个确认消息。你可以通过运行 `subscription-manager list` 命令来查看是否已经成功注册。 5. **激活订阅**:根据需要,可能还需要激活订阅,如果提示需要,执行 `subscription-manager activate --product-id=产品ID`,其中`产品ID`是你订阅的产品代码。 6. **重新启动服务**:完成上述步骤后,重启系统或者相关的服务 (`systemctl restart subscription-manager` 或 `systemctl restart yum` 或 `dnf`,具体取决于你的系统) 以确保更改生效。 如果以上步骤无法解决问题,你可能需要联系你的IT管理员或者查阅更详细的官方文档,因为这可能是由于网络问题、权限限制或订阅配置错误导致的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值