On Red Hat Enterprise Linux 9 itself (not Rocky / Alma), you need an active subscription to pull packages from Red Hat's CDN — including the AppStream repo where most language runtimes live. This guide registers the system, attaches a subscription, and enables AppStream.
Prerequisites
- A RHEL 9 host with
sudo. - An active Red Hat Developer (free) or paid subscription. Sign up at
developers.redhat.com. - Outbound HTTPS to
subscription.rhsm.redhat.comandcdn.redhat.com.
Step 1: Check current state
sudo subscription-manager status
sudo subscription-manager identity
sudo dnf repolist
A freshly installed RHEL 9 with no subscription will say Overall Status: Disabled and dnf repolist will be empty.
Step 2: Register the host
sudo subscription-manager register --username your@redhat.com
# Password prompt follows.
For automation, use a Red Hat activation key:
sudo subscription-manager register \
--org=12345678 \
--activationkey=production-baseline
Step 3: Attach a subscription pool
auto-attach picks the best match from the pools available to your account — usually right.
sudo subscription-manager attach --auto
sudo subscription-manager list --consumed
You should see pool entitlements listed.
Step 4: Enable the standard repos
sudo subscription-manager repos --list-enabled
sudo subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
sudo subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
# Common extras
sudo subscription-manager repos --enable=codeready-builder-for-rhel-9-x86_64-rpms
baseos is the minimal OS. appstream is where PHP, Node, Postgres, Python and friends live. CRB (CodeReady Builder) ships development headers.
Step 5: Refresh metadata and confirm
sudo dnf clean all
sudo dnf makecache
dnf repolist
repolist should now show the three repos as enabled with package counts in the thousands.
Step 6: Install something from AppStream
dnf module list nodejs
sudo dnf module enable -y nodejs:20
sudo dnf module install -y nodejs:20/common
node --version
Verify
sudo subscription-manager status
sudo subscription-manager identity
dnf repolist enabled
sudo subscription-manager refresh
Overall Status: Current is what you want.
Conclusion
Once registered, RHEL behaves like any other DNF distro — same commands, same modules, same upgrade flow. If you do not need the Red Hat support contract, Rocky 9 or Alma 9 gives you the same binary platform without registration.
Next steps
- For unregistered alternatives see Install Rocky Linux 9.
- Configure inbound traffic with firewalld zones.
- Learn the daily commands in DNF package manager basics.
Comments
0 total · 0 threads