每当我运行“yum list update”时,我都会再次收到此错误

每当我运行“yum list update”时,我都会再次收到此错误
# yum list updates
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management.
You can use subscription-manager to register.

配置的存储库之一失败(未知),并且 yum 没有足够的缓存数据来继续。此时 yum 能做的唯一安全的事情就是失败。有几种方法可以“修复”这个问题:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. 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).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, 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 <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. 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 much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

答案1

每当我运行此命令时,我都会再次收到此错误。有人知道解决方案吗?

是的,停止运行该命令:)


所有存储库定义都在/etc/yum.repos.d/

你有一个空的 redhat.repo文件,因为你安装了 rhel 但是你做了(这很好)但你从来没有活性您使用给定的 rhel 许可证进行安装...这不一定是坏事,它只是意味着您无法访问官方 redhat 存储库来正确更新您的系统并安装 redhat 可能提供的任何其他软件或库。

例如我的 redhat.repo 文件看起来像这样......

#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated.  Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#

[rhel-7-server-extras-rpms]
metadata_expire = 86400
enabled_metadata = 1
sslclientcert = /etc/pki/entitlement/16959377048969.pem
baseurl = https://cdn.redhat.com/content/dist/rhel/server/7/7Server/$basearch/extras/os
proxy =
ui_repoid_vars = basearch
sslverify = 1
name = Red Hat Enterprise Linux 7 Server - Extras (RPMs)
sslclientkey = /etc/pki/entitlement/169048969744555-key.pem
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
gpgcheck = 1

[rhel-7-server-rpms]
metadata_expire = 86400
enabled_metadata = 1
sslclientcert = /etc/pki/entitlement/1695934543375315.pem
baseurl = https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/os
proxy =
ui_repoid_vars = releasever basearch
sslverify = 1
name = Red Hat Enterprise Linux 7 Server (RPMs)
sslclientkey = /etc/pki/entitlement/1695935504896975315-key.pem
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
gpgcheck = 1

它还有更多,enabled=0但填充的内容取决于您购买的 rhel 许可证。但我上面展示的这两个基本上是基本功能真正需要的主要功能。

您还可以epel-release-latest-7.noarch.rpmhttps://fedoraproject.org/wiki/EPEL

或者如果您现在有网络连接,您可以立即执行

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

或者对于 rhel8:yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

之后您将看到一个/etc/yum.repos.d/epel.repo. EPEL 是免费的,因此您现在就可以这样做并访问 EPEL 提供的任何内容。但 EPEL 不提供内核更新,您现在需要支付基本的 rhel 订阅费用才能在 redhat 存储库中注册您的系统。

还要知道您可以指向许多其他存储库,大多数是免费的,有些是付费的。 CentOS 是 RHEL,其中 CentOS 是免费的,没有官方[付费]支持。

https://wiki.centos.org/AdditionalResources/Repositories

如果您使用 Linux 来进行个人/家庭/娱乐,那么一定要使用 CentOS,不使用 RHEL 也不会丢失任何东西。如果它是一个正在运行的系统,并且有合法性,那么你的公司应该支付 rhel 订阅费用。但要知道,很多人确实在工作环境中正式使用 CentOS,只是要注意 centos 没有像 rhel 那样的付费官方支持。

相关内容