I want to upgrade RHEL 8 to 9, but RHEL 9 repositories are not listed in RHEL 8
Environment
- Red Hat Enterprise Linux 8.6
- Red Hat Satellite 6.X
- Leapp
Issue
-
I've a created a Content View with the required RHEL 8 and RHEL 9 repositories, but I can't see the RHEL 9 repositories in the host:
[root@satellite ~]# hammer content-view info --id 3 | grep Name | grep "Red Hat" Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs x86_64 8.1 Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs x86_64 8.1 Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS RPMs x86_64 9.1 Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream RPMs x86_64 9.1[root@server ~]# subscription-manager repos --list | grep Name Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) Repo Name: Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) [root@server ~]# yum repolist rhel-8-for-x86_64-appstream-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 0 rhel-8-for-x86_64-baseos-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 0
Resolution
-
In a RHEL 8 system, a product certificate of Red Hat Enterprise Linux 8 is installed, so RHEL 9 repositories are not listed. Check the product certificate installed with
subscription-manager list --installed[root@server ~]# subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Product ID: 479 Version: 8.0 Arch: x86_64 Status: Subscribed Status Details: Starts: 09/30/2019 Ends: 09/29/2024 -
You can see your host has access to RHEL 9 repositories checking the RHSM cache files content_overrides.json and written_overrides.json in /var/lib/rhsm/cache/:
[root@server ~]# grep -R "rhel-9" /var/lib/rhsm/cache/* /var/lib/rhsm/cache/content_overrides.json:[{"created": "2022-09-21T16:28:19+0000", "updated": "2022-09-21T16:28:19+0000", "contentLabel": "rhel-9-server-rpms", "name": "enabled", "value": "1"}, {"created": "2022-09-21T16:28:19+0000", "updated": "2022-09-21T16:28:19+0000", "contentLabel": "rhel-8-for-x86_64-appstream-rpms", "name": "enabled", "value": "1"}, {"created": "2022-09-21T16:28:19+0000", "updated": "2022-09-21T16:28:19+0000", "contentLabel": "rhel-8-for-x86_64-baseos-rpms", "name": "enabled", "value": "1"}] /var/lib/rhsm/cache/written_overrides.json:{"rhel-9-server-rpms": {"enabled": "1"}, "rhel-8-for-x86_64-appstream-rpms": {"enabled": "1"}, "rhel-8-for-x86_64-baseos-rpms": {"enabled": "1"}} -
In the upgrade process, Leapp has it's own way to detect and enable the target release repos when you do preupgrade or upgrade.
Root Cause
-
Subscription certificates are stored in the /etc/pki/ directory and its subdirectories. Red Hat products certificates that are installed on the system are stored in /etc/pki/product or /etc/pki/product-default. This product certificate identifies the release version, architecture and name of the Red Hat Enterprise Linux system installed on the computer.
[user@server ~]$ rct cat-cert /etc/pki/product-default/479.pem +-------------------------------------------+ Product Certificate +-------------------------------------------+ Certificate: Path: /etc/pki/product-default/479.pem Version: 1.0 Serial: 12750047592154751339 Start Date: 2019-02-13 13:06:23+00:00 End Date: 2039-02-08 13:06:23+00:00 Subject: CN: Red Hat Product ID [5e46b602-95fb-46c2-b916-c8f82759f4be] Issuer: C: US CN: Red Hat Entitlement Product Authority O: Red Hat, Inc. OU: Red Hat Network ST: North Carolina emailAddress: ca-support@redhat.com Product: ID: 479 Name: Red Hat Enterprise Linux for x86_64 Version: 8.0 Arch: x86_64 Tags: rhel-8,rhel-8-x86_64 Brand Type: Brand Name: -
Repositories with a product certificate different than the one installed, are not listed.
-
Check the article Get Started with Red Hat Subscription Management for a more detailed explanation about the Entitlements and Product Certificates.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.