RHEL 6以上操作系統Yum提示This system is not registered

RHEL 6以上操作系統Yum提示This system is not registered

一、問題現象:

[root@open_source ~]# yum clean

Loaded plugins: product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You
can use subscription-manager to register.

Error: clean requires an option: headers, packages, metadata,
dbcache, plugins, expire-cache, rpmdb, all

 

[root@open_source ~]# yum check-update

Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You
can use subscription-manager to register.

 

[root@open_source ~]# yum makecache

Loaded plugins: product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You
can use subscription-manager to register.

base                                                                               
| 2.8 kB  00:00:00     

Metadata Cache Created

二、問題原因:

   因爲我的操作系統使用的是RedHat,提示需要註冊訂閱,說白了就是要掏錢纔給用。

三、問題分析:

   該問題的處理辦法實際上很簡單,因爲RedHat是商業版企業Linxu系統,其涉及到的包只有Yum,我們可以通過替換社區版的包解決此問題。 

四、解決辦法:

   替換社區版CentOS的包解決此問題。

4.1. 獲取包的途徑主要有以下幾個:

http://mirror.centos.org/

http://mirrors.163.com/

https://mirrors.edge.kernel.org/

http://mirrors.aliyun.com/centos/

http://mirrors.sohu.com

……

4.2.我通過Centos Yum站點下載以下四個所需的包

http://mirror.centos.org/centos-7/7.7.1908/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

http://mirror.centos.org/centos-7/7.7.1908/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm

http://mirror.centos.org/centos-7/7.7.1908/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm

http://mirror.centos.org/centos-7/7.7.1908/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

http://mirror.centos.org/centos-7/7.7.1908/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm

  **注意:下載的包要大於或等於當前系統版本,下載之前要確認操作系統版本,可通過命令cat

/etc/redhat-release 查看。**

4.3 卸載系統中現有的yum包

[root@open_source ~]# rpm -qa|grep yum

yum-metadata-parser-1.1.4-10.el7.x86_64

yum-3.4.3-163.el7.noarch

yum-rhn-plugin-2.0.1-10.el7.noarch

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

[root@open_source ~]# rpm -qa|grep yum

[root@open_source ~]#

4.4 分別安裝剛纔下載的幾個RPM包

[root@open_source CentOS_yum]# rpm -ivh
python-iniparse-0.4-9.el7.noarch.rpm 

warning: python-iniparse-0.4-9.el7.noarch.rpm: Header V3 RSA/SHA256
Signature, key ID f4a80eb5: NOKEY

Preparing...                         
################################# [100%]

        package
python-iniparse-0.4-9.el7.noarch is already installed

        file
/usr/lib/python2.7/site-packages/iniparse/ini.pyc from install of
python-iniparse-0.4-9.el7.noarch conflicts with file from package
python-iniparse-0.4-9.el7.noarch

        file
/usr/lib/python2.7/site-packages/iniparse/ini.pyo from install of python-iniparse-0.4-9.el7.noarch
conflicts with file from package python-iniparse-0.4-9.el7.noarch

 

[root@open_source CentOS_yum]# rpm -ivh
python-urlgrabber-3.10-9.el7.noarch.rpm 

warning: python-urlgrabber-3.10-9.el7.noarch.rpm: Header V3
RSA/SHA256 Signature, key ID f4a80eb5: NOKEY

Preparing...                         
################################# [100%]

        package
python-urlgrabber-3.10-9.el7.noarch is already installed

        file
/usr/lib/python2.7/site-packages/urlgrabber/grabber.pyc from install of
python-urlgrabber-3.10-9.el7.noarch conflicts with file from package
python-urlgrabber-3.10-9.el7.noarch

        file
/usr/lib/python2.7/site-packages/urlgrabber/grabber.pyo from install of
python-urlgrabber-3.10-9.el7.noarch conflicts with file from package
python-urlgrabber-3.10-9.el7.noarch

 

[root@open_source
CentOS_yum]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm 

warning: yum-metadata-parser-1.1.4-10.el7.x86_64.rpm: Header V3
RSA/SHA256 Signature, key ID f4a80eb5: NOKEY

Preparing...                          #################################
[100%]

Updating / installing...

  
1:yum-metadata-parser-1.1.4-10.el7 #################################
[100%]

 

[root@open_source CentOS_yum]# rpm -ivh
yum-3.4.3-163.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm


warning: yum-3.4.3-163.el7.centos.noarch.rpm: Header V3 RSA/SHA256
Signature, key ID f4a80eb5: NOKEY

Preparing...                         
################################# [100%]

Updating / installing...

   1:yum-plugin-fastestmirror-1.1.31-5#################################
[ 50%]

  
2:yum-3.4.3-163.el7.centos        
################################# [100%]

 

[root@open_source CentOS_yum]# rpm -qa|grep yum

yum-metadata-parser-1.1.4-10.el7.x86_64

yum-3.4.3-163.el7.centos.noarch

yum-plugin-fastestmirror-1.1.31-52.el7.noarch

4.5 驗證

[root@open_source CentOS_yum]# yum makecache

Loaded plugins: fastestmirro


r, product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You can
use subscription-manager to register.

Determining fastest mirrors

base                                                                                                                      
| 2.8 kB  00:00:00     

(1/5): base/group_gz                                                                                                      
| 103 kB  00:00:00     

(2/5): base/primary                                                                                         
              | 2.0 MB  00:00:00    


(3/5): base/filelists                                                                                                     
| 3.1 MB  00:00:00     

(4/5): base/productid                                                 
                                                    |
1.6 kB  00:00:00     

(5/5): base/other                                                                                                         
| 1.1 MB  00:00:00     

base                            
                                                                                                       5229/5229

base                                                                                                                                   
5229/5229

base                                                                                                                                   
5229/5229

Metadata Cache Created

 

[root@open_source CentOS_yum]# yum install -y ftp

Loaded plugins: fastestmirror, product-id, search-disabled-repos,
subscription-manager

This system is not registered with an entitlement server. You can
use subscription-manager to register.

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package ftp.x86_64 0:0.17-67.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

==================================================================================================================================================

 Package                        Arch                              Version                                  
Repository                      
Size

==================================================================================================================================================

Installing:

 ftp                            x86_64                            0.17-67.el7                               base                             61 k

 

Transaction Summary

==================================================================================================================================================

Install  1 Package

 

Total download size: 61 k

Installed size: 96 k

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Warning: RPMDB altered outside of yum.

** Found 1 pre-existing rpmdb problem(s), 'yum check' output
follows:

rhn-check-2.0.2-24.el7.x86_64 has missing requires of
yum-rhn-plugin >= ('0', '1.6.4', '1')

  Installing :
ftp-0.17-67.el7.x86_64                                                                                                        
1/1 

  Verifying  : ftp-0.17-67.el7.x86_64                                                      
                                                  1/1


 

Installed:

  ftp.x86_64
0:0.17-67.el7                                                                                                                       


 

Complete!

通過替換Yum包的方式完成問題處理,Yum可以正常使用了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章