yum执行命令报警yum install时提示This system is not registered with an entitlement server

在这里插入图片描述

This system is not registered with an entitlement server


在这里插入图片描述

在一秒钟内看到本质的人和花半辈子也看不清一件事本质的人,自然是不一样的命运。


因为使用redhat自带的yum源要付费,所以需要自己重新生成yum源。

在这里插入图片描述

1.Uninstall yum package

  • 查询yum安装的包
    rpm -qa | grep yum

    在这里插入图片描述

  • 将安装包卸载(单个卸)
    sudo rpm -e xxxxx --nodeps

    在这里插入图片描述

  • 将安装包卸载(全卸) 我没执行成功
    rpm -qa|grep yum|xargs rpm -e --nodeps

  • 下载安装CentOS的yum源
    如下几个网站均可,找到图片中的包进行下载
    1.阿里云网络源地址:https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
    2.网易163网络源地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/
    3.CentOS网络源地址:http://centos.ustc.edu.cn/centos/7/os/x86_64/Packages/

    在这里插入图片描述


    在这里插入图片描述

  • 安装全部
    sudo rpm -ivh python-
    sudo rpm -ivh yum-

  • 安装完检查一下
    rpm -qa | grep yum

  • 安装某个 个别可能失败,有先后顺序
    sudo rpm -ivh xxxx

    在这里插入图片描述

2.Yum Repo

  • 下载yum源
    http://mirrors.163.com/.help/CentOS7-Base-163.repo
    http://mirrors.aliyun.com/repo/Centos-7.repo
  • 修改配置
    cd /etc/yum.repo.d/
    vim CentOS-Base.repo =>没有就create,有则edit
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  • 上面的yum包都是7版本的
  • 将所有的$releasever全部替换成版本号>7

    在这里插入图片描述

  • 进入编辑模式:
    %s/$releasever/7/g
  • 保存
    :wq
  • 清理缓存
    yum clean all
  • 重新生成缓存
    yum makecache
  • 查看仓库
    yum repolist all

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...