如何安装 RHEL6 的主要存储库

如何安装 RHEL6 的主要存储库

我们已经在新服务器上设置了 RHEL6。据我们所知,我们的订阅已全部正确设置。但是,当我运行 时yum repolist,它没有显示任何存储库。/etc/yum.repos.d/redhat.repo 是空的。我尝试从另一个 RHEL6 服务器的 redhat.repo 粘贴内容,但只要我运行yum,它就会再次将其清除。我只需要设置基本的 RedHat 存储库,这样我就可以安装软件包。

为了确保我没有遇到订阅问题。我重新注册并重新订阅。我得到的结果都一样。

# subscription-manager register --force
# subscription-manager subscribe --pool=*redacted*

当我登录 RedHat 客户门户时,它显示该订阅处于活动状态。

使用 GUI,我进入系统 > 管理 > Red Hat 订阅管理器。在“产品”选项卡下,没有显示任何产品。

当我运行时yum update,我得到的结果如下:

# yum update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Setting up Update Process
No Packages marked for Update

的内容/etc/yum.conf

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

内容/etc/yum/pluginconf.d/rhnplugin.conf

[main]
enabled = 0
gpgcheck = 1

答案1

以下是我解决问题的方法,至少是暂时的。我/etc/yum.repos.d/redhat.repo从另一台正常运行的 rhel6 服务器复制了该文件。然后,我用这台服务器上的 .pem 文件替换了 sslclientkey 和 sslclientcert 的所有实例。然后,我重命名了 .repo 文件,以避免它在更新时被清除。通过这样做,我能够按预期安装所有软件包。

我必须继续与支持人员合作来解决这个问题的根源。

更新

Red Hat 支持最终回复了我下面的说明,解决了问题的根源,一切正常:

检查您的注册系统后,我们发现您当前已通过 RHSM 注册了它们,并且其中一个系统也通过 RHN classic 注册。

通过客户门户登录后导航到以下位置,通过选中复选框并单击左下角的“删除所选”来删除两个系统:

https://access.redhat.com/management/consumers/

在系统“GH-Server-5”上的终端上以 root 身份本地完成上述操作后,发出以下命令:

rhn_register

上述命令将打开一个终端 tui 用于 RHN Classic 注册并要求输入用户名和密码。这些是您的客户门户登录名和密码。除非您需要有限的更新,否则请确保检查所有可用更新。

当基于终端的 tui 完成您的注册后,发出以下命令来清除 yum 的缓存并添加正确的存储库,然后最后更新:

yum clean all
yum repolist
yum update

答案2

正如 rhnplugin.conf 的内容所示,该插件已被禁用。它不应该被禁用,因此请通过更改enabled = 0为 来重新启用它enabled = 1

答案3

# subscription-manager register
Username: [email protected]
Password: 
The system has been registered with ID: 653cb615-5f5e-4339-8d28-6dc67169ecb1 
# subscription-manager repos
This system has no repositories available through subscriptions.
# subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        6.5 Beta
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not covered by a valid subscription.
Starts:         
Ends: 
# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed
# subscription-manager repos
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-6-server-sam-source-rpms
Repo Name: Red Hat Subscription Asset Manager (for RHEL 6 Server) (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/subscription-asset-manager/1/source/SRPMS
Enabled:   0

Repo ID:   rhel-ha-for-rhel-6-server-beta-debug-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 6 Server) Beta (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/highavailability/debug
Enabled:   0

Repo ID:   rhel-6-server-rhev-agent-beta-debug-rpms
Repo Name: Red Hat Enterprise Virtualization Agents for RHEL 6 Server Beta (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/rhev-agent/3/debug
Enabled:   0

Repo ID:   rhel-6-server-cf-tools-1-source-rpms
Repo Name: Red Hat CloudForms Tools for RHEL 6 (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/cf-tools/1/source/SRPMS
Enabled:   0

Repo ID:   rhel-6-server-rpms
Repo Name: Red Hat Enterprise Linux 6 Server (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/os
Enabled:   1
...snip...
# yum repolist
Loaded plugins: product-id, security, subscription-manager, versionlock
This system is receiving updates from Red Hat Subscription Management.
rhel-6-server-cf-tools-1-rpms                                                                                                           | 2.8 kB     00:00     
rhel-6-server-cf-tools-1-rpms/primary_db                                                                                                |  18 kB     00:00     
rhel-6-server-rhev-agent-rpms                                                                                                           | 3.1 kB     00:00     
rhel-6-server-rhev-agent-rpms/primary_db                                                                                                |  18 kB     00:00     
rhel-6-server-rpms                                                                                                                      | 3.7 kB     00:00     
rhel-6-server-rpms/primary_db                                                                                                           |  23 MB     00:11     
rhel-ha-for-rhel-6-server-rpms                                                                                                          | 3.7 kB     00:00     
rhel-ha-for-rhel-6-server-rpms/primary_db                                                                                               | 203 kB     00:00     
rhel-lb-for-rhel-6-server-rpms                                                                                                          | 3.7 kB     00:00     
rhel-lb-for-rhel-6-server-rpms/primary_db                                                                                               |  14 kB     00:00     
rhel-rs-for-rhel-6-server-rpms                                                                                                          | 3.7 kB     00:00     
rhel-rs-for-rhel-6-server-rpms/primary_db                                                                                               | 223 kB     00:00     
repo id                                                  repo name                                                                                       status
epel                                                     Extra Packages for Enterprise Linux 6 -                                                          9,984
rhel-6-server-cf-tools-1-rpms                            Red Hat CloudForms Tools for RHEL 6 (RPMs)                                                          31
rhel-6-server-rhev-agent-rpms                            Red Hat Enterprise Virtualization Agents for RHEL 6 Server (RPMs)                                   32
rhel-6-server-rpms                                       Red Hat Enterprise Linux 6 Server (RPMs)                                                        11,114
rhel-ha-for-rhel-6-server-rpms                           Red Hat Enterprise Linux High Availability (for RHEL 6 Server) (RPMs)                              287
rhel-lb-for-rhel-6-server-rpms                           Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server) (RPMs)                                   11
rhel-rs-for-rhel-6-server-rpms                           Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server) (RPMs)                              333
repolist: 40,228

答案4

快速搜索找到 Red Hat 解决方案#67936建议联系支持人员来解决。

可能是您的授权证书已损坏。

  • 验证授权证书openssl x509 -in /etc/pki/entitlement/3019xxxxxxxxxxxxxxx.pem -text -noout
  • 检查/var/log/messages来自 rhsm-complianced 的警告
  • 检查rhsm.log日志文件中的消息
  • 运行yum update以验证初始更新后存储库是否填充。

相关内容