看这篇文章前,先说一下我的实际情况。本来要部署docker服务的,然后yum安装任何软件都不起效果,最后通过老师远程的帮助,最后成功安装上docker,老师的解决办法就是忽略这个问题,直接自己配置网络yum源,然后完美解决(对,没错下面的文章内容可以不用看了)。由于机子没开虚拟化,结果启动docker服务时报错。开启CPU虚拟化后,又出现新的错误,docker的oci报错,oci是docker网络标准,结果更新系统,重启机器问题已解决。

使用yum命令安装软件时候出现以下错误:

Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://mirrors.163.com/centos/7Server/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror. One of the configured repositories failed (CentOS-7Server - Base - .com),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this: . Contact the upstream for the repository and get them to fix the problem. . Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work). . Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage: yum-config-manager --disable base . Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise: yum-config-manager --save --setopt=base.skip_if_unavailable=true failure: repodata/repomd.xml from base: [Errno ] No more mirrors to try.
http://mirrors.163.com/centos/7Server/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

网上说:使用redhat的yum源是需要注册付费的

1.毫不犹豫卸载RedHat自带的yum包

# rpm -qa|grep yum|xargs rpm -e --nodeps

[root@localhost yum.repos.d]# rpm -qa|grep yum
yum-metadata-parser-1.1.-.el7.x86_64
yum-utils-1.1.-.el7.noarch
yum-3.4.-.el7.noarch
yum-rhn-plugin-2.0.-.el7.noarch
[root@localhost yum.repos.d]# rpm -qa|grep yum|xargs rpm -e --nodeps
[root@localhost yum.repos.d]# rpm -qa|grep yum
[root@localhost yum.repos.d]#

2.使用国内新的centos的yum包替换redhat自带的

首先你得先弄清楚自己的系统版本号和系统位数

如果是i386或者i686就是32位的,如果是x86_64就是64位的

# cat /etc/redhat-release

# uname -a

[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.-.el7.x86_64 # SMP Mon May :: EDT x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#

然后到

http://mirrors.kernel.org/centos/

或者

http://mirrors.163.com/centos/

找对应系统版本号和系统位数下载,找到yum、yum-plugin-fastestmirror、yum-metadata-parser、python-urlgrabber这四个软件包下载

上传都Linux系统中

[root@localhost ~]# ls
anaconda-ks.cfg python-urlgrabber-3.10-.el7.noarch.rpm yum-metadata-parser-1.1.-.el7.x86_64.rpm
python-iniparse-0.4-.el7.noarch.rpm yum-3.4.-.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el7.noarch.rpm
[root@localhost ~]#

你也可以直接使用wget命令直接下载,命令如下:

# wget https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm

# wget https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

# wget https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

# wget https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm

# wget https://mirrors.edge.kernel.org/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm

接着就是分别安装几个包

# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm

[root@localhost ~]# rpm -ivh python-iniparse-0.4-.el7.noarch.rpm
warning: python-iniparse-0.4-.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, ke y ID f4a80eb5: NOKEY
Preparing... ################################# [%]
package python-iniparse-0.4-.el7.noarch is already installed
file /usr/lib/python2./site-packages/iniparse/ini.pyc from install of py thon-iniparse-0.4-.el7.noarch conflicts with file from package python-iniparse- .-.el7.noarch
file /usr/lib/python2./site-packages/iniparse/ini.pyo from install of py thon-iniparse-0.4-.el7.noarch conflicts with file from package python-iniparse- .-.el7.noarch

# rpm -ivh python-urlgrabber-3.10-9.el7.noarch.rpm

[root@localhost ~]# rpm -ivh python-urlgrabber-3.10-.el7.noarch.rpm
warning: python-urlgrabber-3.10-.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [%]
file /usr/lib/python2./site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.10-.el7.noarch conflicts with file from package python-urlgrabber-3.10-.el7.noarch
file /usr/lib/python2./site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.10-.el7.noarch conflicts with file from package python-urlgrabber-3.10-.el7.noarch
file /usr/lib/python2./site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.10-.el7.noarch conflicts with file from package python-urlgrabber-3.10-.el7.noarch

# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.-.el7.x86_64.rpm
warning: yum-metadata-parser-1.1.-.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:yum-metadata-parser-1.1.-.el7 ################################# [%]

这2个rpm要一起装!!!

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

结果报错了

[root@localhost ~]# rpm -ivh yum-3.4.-.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el7.noarch.rpm
warning: yum-3.4.-.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
python-urlgrabber >= 3.10- is needed by yum-3.4.-.el7.centos.noarch
rpm >= :4.11.- is needed by yum-3.4.-.el7.centos.noarch

然后我三个包一起装

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm python-urlgrabber-3.10-9.el7.noarch.rpm

出现如下错误

[root@localhost ~]# rpm -ivh yum-3.4.-.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el7.noarch.rpm python-urlgrabber-3.10-.el7.noarch.rpm
warning: yum-3.4.-.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
rpm >= :4.11.- is needed by yum-3.4.-.el7.centos.noarch
[root@localhost ~]#

解决方法: 将所依赖的python-urlgrabber和rpm包升级

# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm

当我执行这条命令的时候报错了,fuck!!

ping百度域名也能通

[root@localhost ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
---- ::-- http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-32.el7.x86_64.rpm
Resolving mirrors..com (mirrors..com)... 59.111.0.251
Connecting to mirrors..com (mirrors..com)|59.111.0.251|:... connected.
HTTP request sent, awaiting response... Not Found
-- :: ERROR : Not Found. [root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.121) () bytes of data.
bytes from 61.135.169.121: icmp_seq= ttl= time=3.74 ms
bytes from 61.135.169.121: icmp_seq= ttl= time=3.66 ms
^C
--- www.a.shifen.com ping statistics ---
packets transmitted, received, % packet loss, time 1001ms
rtt min/avg/max/mdev = 3.668/3.705/3.743/0.071 ms
[root@localhost ~]#

然后只能自行下载然后上传到Linux

[root@localhost ~]# ls
anaconda-ks.cfg rpm-4.11.-.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.-.el7.noarch.rpm
python-iniparse-0.4-.el7.noarch.rpm yum-3.4.-.el7.centos.noarch.rpm
python-urlgrabber-3.10-.el7.noarch.rpm yum-metadata-parser-1.1.-.el7.x86_64.rpm
[root@localhost ~]#

升级安装

# rpm -Uvh rpm-4.11.3-35.el7.x86_64.rpm --nodeps

# rpm -Uvh python-urlgrabber-3.10-9.el7.noarch.rpm --nodeps

[root@localhost ~]# rpm -Uvh rpm-4.11.-.el7.x86_64.rpm --nodeps
warning: rpm-4.11.-.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:rpm-4.11.-.el7 ################################# [ %]
Cleaning up / removing...
:rpm-4.11.-.el7 ################################# [%]
[root@localhost ~]#
[root@localhost ~]# rpm -Uvh python-urlgrabber-3.10-.el7.noarch.rpm --nodeps
warning: python-urlgrabber-3.10-.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:python-urlgrabber-3.10-.el7 ################################# [ %]
Cleaning up / removing...
:python-urlgrabber-3.10-.el7 ################################# [%]
[root@localhost ~]#

再次安装

# rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

[root@localhost ~]# rpm -ivh yum-3.4.-.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el7.noarch.rpm
warning: yum-3.4.-.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:yum-plugin-fastestmirror-1.1.-################################# [ %]
:yum-3.4.-.el7.centos ################################# [%]
[root@localhost ~]#

查看所有yum包

[root@localhost ~]# rpm -qa | grep yum
yum-metadata-parser-1.1.-.el7.x86_64
yum-3.4.-.el7.centos.noarch
yum-plugin-fastestmirror-1.1.-.el7.noarch

end

参考博客:

https://blog.csdn.net/indexman/article/details/79570577

https://blog.csdn.net/ytx2014214081/article/details/78468947

redhat7更换yum

https://blog.csdn.net/qq_39136872/article/details/81225752

rhel7.0解决:This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.的更多相关文章

  1. Posts Tagged ‘This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register问题的解决办法

    HowTo Install redhat package with YUM command without RHN February 26, 2014 in Redhat / Linux Tips a ...

  2. 【问题】This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

    转载请注明出处:https://www.cnblogs.com/kelamoyujuzhen/p/9087725.html  这类问题归根到底就是软件源问题,Linux下安装软件不像windows.L ...

  3. 使用yum时报错 This system is not registered to Red Hat Subscription Management

    错误原因:使用redhat的yum源是需要注册付费的. 1.卸载RedHat自带的yum包 查看已安装的yum rpm -qa|grep yum #卸载已安装的yum rpm -qa | grep y ...

  4. red-hat6.5 yum 源配置,cloud-init 安装 This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register

    This system is not registered to Red Hat Subscription Management. You can use subscription-manager t ...

  5. RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management

    我虚拟机安装的系统是RedHat Enterprise Linux 6.4-i686,是32位的.使用yum命令安装软件时候出现以下错误: This system is not registered ...

  6. red hat 6.5 红帽企业Linux.6.5 yum This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 解决办法

    1.删除redhat原有的yum rpm -aq|grep yum|xargs rpm -e --nodeps 2.下载yum安装文件 wget http://mirrors.163.com/cent ...

  7. [转]redhat7(centos7) not registered to Red Hat Subscription Management

    [root@controller0 ~]# yum install ntp Loaded plugins: fastestmirror, product-id, search-disabled-rep ...

  8. How to delete System Profiles for those registered with Red Hat Subscription Management (RHSM)?

    Environment Red Hat Customer Portal Certificate Based Subscription Red Hat Subscription Management ( ...

  9. 如何解决This system is not registered with RHN.

    今天我必须写下这篇文章,由于在我刚刚接触到Linux下安装oracle时碰到了Linux中少xscreensaver.rpm包自己弄了非常久.最后还是被一个大哥帮我攻克了:仅仅能说非常的感谢你! 我试 ...

随机推荐

  1. Python--异常处理和断言

    try关键字,定义获取程序错误 except关键字,出现异常错误执行里面的代码 Exception定义错误类,Exception能获取到所有类型的错误错误,as创建错误对象名称,自动获取错误信息 #! ...

  2. go build Multiple main.go file

    golang 如何编译同目录下多个main文件? 多个go 文件在相同目录编译时候会报错, 可将文件放在不同的package下,结构如下: buidtest/├── a│   └── a.go└── ...

  3. Centos7安装teamviewer 32/64位

    centos7安装teamviewer teamviewer安装包,自己去官网下吧,不用找了,估摸着就没有Centos7 64位的 所以直接下centos teamviewer 32位那个rpm包吧 ...

  4. C# Winform 怎么让按钮在Panel里居中显示

    把pannel里面的多个按钮的那个anchor属性全部去掉,如下图: 再用VS2010自带的工具调一下即可: 小注: 有的时候我们却想子控件在父控件里的相对位置不要随着父控件的变大缩小而变化,或者控件 ...

  5. C#中Socket关闭 Close、Dispose、Shutdown、Disconnect

    An answer on StackOverflow made me think I have finally reached some glimpse of an understanding. Th ...

  6. char/unsigned char/int/short 存储范围

    Type Storage size Value range char 1 byte -128 to 127 or 0 to 255 unsigned char 1 byte 0 to 255 sign ...

  7. TP5 中引入第三方类库

    通过了解tp5的目录结构,我们知道其中有两个目录是纺织扩展类库文件的. extend是放置自定义或者其他类文件的. vendor目录是放置composer类库文件的. 当我们的第三方类库文件是下载的, ...

  8. 大数据离线分析平台 JSSDK数据收集引擎编写

    JsSDK设计规则在js sdk中我们需要收集launch.pageview.chargeRequest和eventDuration四种数据,所以我们需要在js中写入四个方法来分别收集这些数据,另外我 ...

  9. spark集群使用hanlp进行分布式分词操作说明

    本篇分享一个使用hanlp分词的操作小案例,即在spark集群中使用hanlp完成分布式分词的操作,文章整理自[qq_33872191]的博客,感谢分享!以下为全文:   分两步: 第一步:实现han ...

  10. centos下cmake编译安装mysql5.7.24

    一.centos6.5推荐最小安装.自定义添加如图两个包 二.安装cmake3.0(mysql5.7要求cmake2.9以上.cmake3.1要求gcc g++4.8以上.所以选自3.0) 1.分别执 ...