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. 获取包的途径主要有以下几个:
https://mirrors.edge.kernel.org/
http://mirrors.aliyun.com/centos/
……
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/yum-3.4.3-163.el7.centos.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可以正常使用了。