CentOS7:This system is not registered to Red Hat Subscription Management

前序:安装jdk

  1. 在官网下载jdk
    jdk-8u241-linux-i586.tar

2.通过SecureFX上传到/usr/local/jdk,并解压出来

3.配置JavaHome
vim /etc/profile

  1. 测试java安装是否成功
    java -version
    报错:-bash: /usr/local/jdk1.8.0_144/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

5.解决办法:
yum install glibc.i686

由此引出了主题:
This system is not registered to Red Hat Subscription Management

正文:通过yum安装软件时,报错This system is not registered to Red Hat Subscription Management。

  • 以下是解决办法
    1.查看系统原来预装的yum
    rpm -qa|grep yum

卸载预装的yum
rpm -qa|grep yum|xargs rpm -e --nodeps
再次查看安装的yum情况
rpm -qa|grep yum

  1. 去国内镜像下载以下的rpm安装包

2.查找的包有

[yum-metadata-parser-1.1.4-10.el7.x86_64.rpm](wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm) 

[yum-3.4.3-163.el7.centos.noarch.rpm](wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-163.el7.centos.noarch.rpm) 

[yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm](wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-52.el7.noarch.rpm)

[python-urlgrabber-3.10-9.el7.noarch.rpm](wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm) 

[python-iniparse-0.4-9.el7.noarch.rpm](wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm)

下载完后

3.通过命令安装
rpm -ivh --nodeps -replasefiles xxx

4.安装完后,查询yum安装情况
rpm -qa|grep yum

5 配置CentOS镜像

//备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
//下载镜像配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
//生成缓存
yum makecache 

报错:


6、编辑CenOS镜像配置文件
vim /etc/yum.repos.d/CentOS-Base.repo
把出现$releaserver的这个变量改成7

  1. 重新 yum makecache

后序:回到检查jdk版本java -version出现的问题:
报错:-bash: /usr/local/jdk1.8.0_144/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

1.重新运行yum install glibc.i686,安装成功

  1. 检查java -version

你可能感兴趣的:(CentOS7:This system is not registered to Red Hat Subscription Management)