subscription-manager
因此,我运行虚拟 RHEL Server 6.0 作为实验室服务器(托管在 Hyper-V 上)来记忆和练习。由于 RHN Classic 不再可用,我设法使用 RPM 安装包。
为了在干净的 RHEL 6.0 安装中完成此操作,我执行以下操作:
- 下载、安装/升级安装所需的依赖项
subscription-manager package
。 - 然后下载并安装 RH 客户门户中为 RHEL 6 提供的最新 SM 包(
subscription-manager-1.20.10-8.el6.x86_64.rpm
)。 - 之后,我能够成功注册系统。但当我尝试订阅时,它失败并出现以下错误:
系统上没有安装任何产品。无需附加订阅。
- 由于这个错误,我
.pem
按照此链接中的说明使用 RH Portal 生成了一个证书https://access.redhat.com/solutions/691873然后将其放入/etc/pki/product
并运行命令:
# restorecon -Rv /etc/pki/product
# chown root.root /etc/pki/product/69.pem
# chmod 644 /etc/pki/product/69.pem
# rct cat-cert /etc/pki/product/69.pem
- 最后我终于能够成功附加订阅:
[root@rhel6-lab ~]# subscription-manager list
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID: 69
Version: 6.0
Arch: x86_64
Status: Subscribed
Status Details:
Starts: 01/30/2022
Ends: 01/30/2025
我遇到的问题是,当我运行yum repolist
或尝试任何包安装/升级时,我收到如下错误:
[root@rhel6-lab ~]# yum update
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Setting up Update Process
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/repodata/repomd.xml: [Errno 14] problem with the local client certificate
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-6-server-rpms. Please verify its path and try again
[root@rhel6-lab ~]#
我尝试了以下操作但没有成功:
- 取消订阅并再次订阅。
- 检查 sslclientkey 和 sslclientcert 文件是否在文件对应的文件
.pem
夹中。/etc/pki/entitlement/
/etc/yum.repos.d/redhat.repo
- 尝试
subscription-manager identity --regenerate --force
再次运行并运行我的凭据。 - 检查路径是否
/var/cache/yum/x86_64/6Server/rhel-6-server-rpms/packages/
存在。 - 已禁用 RHN Classic(
/etc/yum/pluginconf.d/rhnplugin.conf
)。 - 重新安装 RHEL 6.0 和订阅管理器。
- 通过运行检查服务器事实
subscription-manager facts --list
。
我还尝试订阅 RHEL 6.5 和 RHEL 6.10 服务器并运行更新(以放弃断开连接的 RHEL 6 存储库),两个版本都允许我运行更新。我还将存储库文件/etc/yum.repos.d/redhat.repo
与版本 6.0 进行了比较,除了 sslclientkey 和 sslclientcert 之外,它们完全相同。
这是我的/etc/yum.conf
文件:
[root@rhel6-lab ~]# cat /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
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@rhel6-lab ~]#
我已经没有选择了,尽管正确订阅了客户门户,却找不到更新 RHEL 6.0 的解决方案,我可以看到已消耗的订阅。