متقدم
البحث فيأدلة «كيف»
طريقة البحث
  • اكتب المهمة بكلماتك (find port، open firewall، disk full) أو الصق رسالة الخطأ بين علامتي تنصيص.
  • اختر «الإجابة السريعة» لترى الأوامر فقط، أو مجالًا لتبقى في مجال واحد.
  • "كلمتان" تجد العبارة بالضبط.
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث
جرّب:

كيف 224System · RHEL

How to register a RHEL server and enable repositories

A fresh RHEL server cannot install or update packages until it is registered with Red Hat (or a Satellite server). Registration connects it to your subscriptions and gives it the repositories BaseOS and AppStream; extra repositories like CodeReady Builder must be enabled by hand. This how-to registers with an activation key (good for automation), checks the status, enables a repository, and unregisters a server before it is deleted.

  • 5 الدروس
  • 3 الأوامر

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

224.1

The quick answer

subscription-manager register --org=1234567 --activationkey=rhel-servers
subscription-manager status
subscription-manager repos --list-enabled
subscription-manager repos --enable codeready-builder-for-rhel-9-x86_64-rpms
dnf repolist

224.2

Step by step

  1. Create an activation key in the Red Hat Hybrid Cloud Console (Inventory → Activation keys): it holds the settings, so no password is typed on servers. Note your organization ID.
  2. Register (line 1) — with Simple Content Access (default for most accounts) no extra "attach" step is needed. Interactive alternative: subscription-manager register --username alice (asks for the password). Newer RHEL also offers rhc connect, which also connects Insights.
  3. Check (lines 2–3) — status shows Content Access Mode is set to Simple Content Access; the enabled list shows BaseOS and AppStream for your version.
  4. Enable extra repositories (line 4) — for example CodeReady Builder (needed by many EPEL packages). List all available: subscription-manager repos --list | grep 'Repo ID'.
  5. Behind a proxy — set it once:
subscription-manager config --server.proxy_hostname=proxy.example.com --server.proxy_port=3128
  1. Automate — the activation key and org ID in your provisioning (Kickstart, cloud-init, Ansible community.general.redhat_subscription / rhel_system_roles). Keep them in a secret store.
  2. Before deleting a server — unregister, so it does not keep using a subscription entry:
subscription-manager unregister
  1. Free for labs — the no-cost Red Hat Developer subscription covers up to 16 systems for development and learning.

224.3

Check that it worked

subscription-manager status shows Overall Status: Registered (or the SCA message); dnf repolist lists rhel-9-for-x86_64-baseos-rpms, …-appstream-rpms and the enabled CodeReady Builder repo; dnf check-update works.

224.4

Common problems

ProblemCauseFix
This system is already registeredOld registration (for example a cloned VM).subscription-manager unregister / clean, then register again.
Unable to reach the serverFirewall or proxy.Allow HTTPS to the Red Hat CDN, or set the proxy.
Invalid activation keyWrong key name or org ID.Copy both from the console; key names are case sensitive.
dnf repolist empty after registerRepos disabled, or the release is pinned to an old minor version.repos --list-enabled; subscription-manager release --unset.
Clones share one identityVM template registered before cloning.Unregister and subscription-manager clean before making a template.
Time errors / SSL errorsWrong system clock.Sync time with chrony.

224.5

Go further

1Why use an activation key instead of a user name and password?

The key holds the registration settings, so no personal password is typed on servers or stored in scripts.

2Why unregister a server before deleting it?

Otherwise it stays in your inventory and may still count against your subscriptions.

كل الأوامر في هذا الفصل