Using Red Hat Subscriptions on Rocky Linux 9 via subscription-manager
Learn how to attach a valid RHEL subscription to Rocky Linux 9 to access the same AppStream and BaseOS repositories, simplifying migration and reducing costs.
20 Sept 2026, 06:43 UTC

Why Use subscription‑manager on Rocky Linux
Rocky Linux 9 ships the same subscription‑manager client that Red Hat Enterprise Linux uses. By registering the system with Red Hat and attaching a valid RHEL subscription, you gain direct access to the official AppStream and BaseOS repositories. This eliminates the need to maintain separate mirror configurations and guarantees package parity with RHEL.
Registering the System
You need a Red Hat Customer Portal account with an active subscription. Run the register command with your portal username (or an activation key) and password.
sudo subscription-manager register --username YOUR_USERNAME --password YOUR_PASSWORD
If you prefer not to store the password in the command line, you can omit the --password flag and enter it interactively.
Attaching a Subscription
After registration, list available pools and attach one automatically, or specify a pool ID.
sudo subscription-manager list --available
Identify the pool that provides the AppStream and BaseOS content (look for 'Red Hat Enterprise Linux' in the description). Then attach it:
sudo subscription-manager attach --pool POOL_ID
Alternatively, let subscription‑manager choose a matching subscription:
sudo subscription-manager attach --auto
Verifying Repository Access
Check that the expected repositories are enabled and that the system shows a valid subscription status.
sudo dnf repolistYou should see entries similar to 'appstream' and 'baseos' with the Red Hat CDN as the baseurl.
Confirm the subscription state:
sudo subscription-manager statusThe output should indicate 'Overall Status: Current' and list the attached pool ID.
Trade‑offs and Limitations
- The feature depends on an active RHEL subscription; if the subscription expires, repository access is blocked until you renew or attach a new entitlement.
- Using a RHEL subscription on Rocky Linux may conflict with Red Hat’s licensing terms for production workloads. Review your subscription agreement or consult legal counsel before deploying in a paid‑support environment.
- Rocky Linux 7 does not include subscription‑manager because it is based on RHEL 7, which is end‑of‑life. Older Rocky 7 systems must continue to use manual repository files or third‑party mirrors.
- Although the packages are binary‑compatible, any Red Hat‑specific trademarks or support assets (e.g., RHN‑specific tools) are not available; you rely on the community‑provided Rocky Linux support channels.
Closing Recommendations
If you already manage a fleet of RHEL systems and want to migrate to Rocky Linux without changing your repository strategy, enable subscription‑manager on Rocky 9 (or newer) and attach your existing entitlements. Keep a record of subscription expiration dates and automate a check with subscription-manager status in your monitoring system to avoid surprise repository loss. For Rocky 7 or environments where licensing prevents using RHEL entitlements, maintain a separate internal mirror of the Rocky Linux repositories.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.