RHCL8无法使用yum install的解决方法

​报错如下:
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Error: There are no enabled repos.
翻译一下就是:无法读取用户标识
此系统未注册到“红帽订阅管理”。您可以使用订阅管理器进行注册。
错误:没有启用的回购。

解决方案:

干掉yum,重新装个centos的yum

# 1. 删除系统自带yum包
[root@localhost ~]# rpm -qa|grep yum
yum-4.0.9.2-5.el8.noarch
# 2. 不检查依赖直接删除所有yum包
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
#  3. 检查是否删除成功
[root@localhost ~]# rpm -qa|grep yum

下一步:

安装yum,使用阿里云镜像,找一下最新版的yum包,和 python3-urllib包
https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/

wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/yum-4.7.0-4.el8.noarch.rpm
wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/yum-utils-4.0.21-3.el8.noarch.rpm
wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/python3-urllib3-1.24.2-5.el8.noarch.rpm
wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/dnf-4.7.0-4.el8.noarch.rpm
wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/python3-dnf-4.7.0-4.el8.noarch.rpm
wget  https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/Packages/python3-dnf-plugins-core-4.0.21-3.el8.noarch.rpm

安装


[root@localhost ~]# rpm -ivh --force --nodeps python3-dnf-4.7.0-4.el8.noarch.rpm
warning: python3-dnf-4.7.0-4.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-dnf-4.7.0-4.el8          ################################# [100%]
[root@localhost ~]# rpm -ivh --force --nodeps python3-dnf-plugins-core-4.0.21-3.el8.noarch.rpm
warning: python3-dnf-plugins-core-4.0.21-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-dnf-plugins-core-4.0.21-3################################# [100%]
[root@localhost ~]# rpm -ivh --force --nodeps dnf-4.7.0-4.el8.noarch.rpm
warning: dnf-4.7.0-4.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:dnf-4.7.0-4.el8                  ################################# [100%]
[root@localhost ~]# rpm -ivh --force --nodeps yum-4.7.0-4.el8.noarch.rpm
warning: yum-4.7.0-4.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:yum-4.7.0-4.el8                  ################################# [100%]
[root@localhost ~]# rpm -ivh --force --nodeps yum-utils-4.0.21-3.el8.noarch.rpm
warning: yum-utils-4.0.21-3.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:yum-utils-4.0.21-3.el8           ################################# [100%]
[root@localhost ~]# rpm -ivh --force --nodeps python3-urllib3-1.24.2-5.el8.noarch.rpm
warning: python3-urllib3-1.24.2-5.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-urllib3-1.24.2-5.el8     ################################# [100%]
[root@localhost ~]# 
posted @ 2024-01-09 11:25  李济宏(Amadeus)  阅读(782)  评论(0编辑  收藏  举报