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

本文介绍了解决RedHat系统在线安装HTTPD时遇到的注册问题的方法。包括卸载原有YUM组件、安装CentOS 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@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


### CentOS 9 Yum 注册问题解决方案 在使用 CentOS 9 系统时,如果遇到 `This system is not registered with an entitlement server. You can use subscription-manager to register.` 的错误提示,这是由于系统未注册到 Red Hat Subscription Management (RHSM) 或者相关服务不可用导致的。以下是解决该问题的详细方法: #### 1. 检查系统的订阅状态 可以运行以下命令检查当前系统的订阅状态: ```bash subscription-manager status ``` 如果系统未注册,将返回类似 `Not registered` 的信息[^1]。 #### 2. 注册系统到 RHSM 通过 `subscription-manager` 工具注册系统到 Red Hat 的订阅管理服务。执行以下命令并按照提示输入有效的用户名和密码: ```bash subscription-manager register ``` 完成注册后,需要附加适当的订阅以启用所需的仓库: ```bash subscription-manager attach --auto ``` #### 3. 启用 CentOS Stream 或其他替代仓库 CentOS 9 是基于 CentOS Stream 构建的,而 CentOS Stream 不再提供免费的 RHEL 订阅支持。因此,可以通过配置 CentOS Stream 的官方仓库来解决问题。编辑 `/etc/yum.repos.d/CentOS-Stream.repo` 文件,并确保以下内容正确配置: ```ini [baseos] name=CentOS Stream $releasever - BaseOS mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [appstream] name=CentOS Stream $releasever - AppStream mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial ``` 保存文件后,运行以下命令清理缓存并生成新的缓存: ```bash yum clean all yum makecache ``` #### 4. 使用第三方源(可选) 如果仍然无法解决问题,可以选择配置第三方源,例如 Vault 或 EPEL 源。首先安装 EPEL 源: ```bash dnf install epel-release ``` 然后根据需求启用其他社区维护的仓库。 #### 5. 安装 VirtualBox 示例 如果用户需要安装 VirtualBox,在上述问题解决后,可以直接运行以下命令安装依赖项和 VirtualBox: ```bash # 安装依赖库 dnf install -y libSDL SDL-devel # 安装 VirtualBox RPM 包 dnf install -y /path/to/VirtualBox-6.1-6.1.32_149290_el7-1.x86_64.rpm ``` #### 注意事项 - 如果系统长期无法注册到 RHSM,建议切换到社区支持的发行版,如 AlmaLinux 或 Rocky Linux。 - 对于开发环境或测试用途,可以考虑使用 Docker 或虚拟机作为替代方案[^2]。 ---
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值