[3] 操作系统 · 2021年10月9日

RHEL8.0 网络和源

Redhat8.0 在使用yum安装软件时,报错:

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.

解决方法:

1、删除系统自带yum包

查看已经安装的yum包

rpm -qa|grep yum

不检查依赖直接删除所有yum包

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

检查是否删除成功

rpm -qa|grep yum

2. 下载新的yum包,并安装

  113  wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/yum-4.4.2-11.el8.noarch.rpm
  114  wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/yum-utils-4.0.18-4.el8.noarch.rpm
  115  wget http://mirrors.163.com/centos/8/BaseOS/x86_64/os/Packages/python3-urllib3-1.24.2-5.el8.noarch.rpm

  116  rpm -ivh --force --nodeps yum-4.4.2-11.el8.noarch.rpm 
  117  rpm -ivh --force --nodeps yum-utils-4.0.18-4.el8.noarch.rpm 
  118  rpm -ivh --force --nodeps python3-urllib3-1.24.2-5.el8.noarch.rpm 

3、配置网络源

  122  cd /etc/yum.repos.d/
  123  ls
  124  mkdir backup
  125  mv redhat.repo backup/
  126  wget -O redhat.repo http://mirrors.aliyun.com/repo/Centos-8.repo
  128  yum clean all
  129  yum makecache 
yum repolist

4、验证

yum install gcc
yum install gcc-c++

参考文献:疾风