RHEL 8のインストール後、新しいパッケージをインストールする前に、Linuxパッケージリポジトリを有効にする必要があります。新しいソフトウェアをインストールしようとすると、次のエラーメッセージが表示されます。
This system has no repositories available through subscriptions.
または
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Error: There are no enabled repos.
または
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions. No repositories available
このチュートリアルでは、次のことを学びます。
- システムをRedHatサブスクリプション管理に登録する方法。
- RHEL8サブスクリプションをシステムにアタッチする方法。
- RHEL8リポジトリを有効にする方法。
- RHEL8リポジトリを無効にする方法。

使用されるソフトウェア要件と規則
カテゴリ | 使用する要件、規則、またはソフトウェアバージョン |
---|---|
Redhat 8 Linux | |
Redhatカスタマープロダクションまたは開発者ユーザーのクレデンシャル | |
rootまたはsudo を介したLinuxシステムへの特権アクセス コマンド。 | |
# –指定されたLinuxコマンドは、rootユーザーとして直接、またはsudo を使用して、root権限で実行する必要があります。 コマンド$ –特定のLinuxコマンドを通常の非特権ユーザーとして実行する必要があります |
Redhat8Linuxでサブスクリプション管理リポジトリを有効にするステップバイステップの説明
ここでは、Redhat 8 Linuxシステムをインストールしたばかりで、リポジトリを有効にして、Red HatEnterpriseLinuxサブスクリプションの準備ができていることを前提としています。
<中央>注有料の本番Redhatサブスクリプションを所有していない場合は、Red Hat Developerプログラムに登録できます。このプログラムを使用すると、RHEL 8をダウンロードしたり、システムを登録したり、リポジトリを有効にしたりできます。
- まず、システムを登録する必要があります。
顧客の詳細を準備し、コマンドラインから顧客の資格情報を提供しながら次のコマンドを実行します。
# subscription-manager register Registering to: subscription.rhsm.redhat.com:443/subscription Username: Password: The system has been registered with ID: 5e3514db-51ef-4287-8168-e598f372ebc4 The registered system name is: rhel8
> - サブスクリプションの取得
Pool ID
。これを行うには、利用可能なすべてのサブスクリプションを一覧表示することから始めます。# subscription-manager list --available
サブスクリプションに応じて、上記のコマンドはサブスクリプションのリストを生成します。サブスクリプションの詳細を確認し、
Pool ID
をメモします システムに添付するサブスクリプションパッケージの例:Subscription Name: Red Hat Enterprise Linux Server Beta Provides: Red Hat CodeReady Linux Builder for x86_64 Beta Red Hat Enterprise Linux for IBM z Systems Beta Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian Red Hat Enterprise Linux Resilient Storage Beta Red Hat Enterprise Linux for x86_64 Beta Red Hat Enterprise Linux for Real Time for NFV Beta Red Hat Enterprise Linux for Real Time Beta Red Hat CodeReady Linux Builder for ARM 64 Beta Red Hat Enterprise Linux Fast Datapath Beta for x86_64 Red Hat CodeReady Linux Builder for Power, little endian Beta Red Hat CodeReady Linux Builder for IBM z Systems Beta Red Hat Enterprise Linux High Availability Beta Red Hat Enterprise Linux for Power, little endian Beta Red Hat Enterprise Linux for ARM 64 Beta SKU: RH00069 Contract: 11796656 Pool ID: 8a85f69c671cb39701671f54cfc365cb Provides Management: No Available: Unlimited Suggested: 1 Service Level: Self-Support Service Type: L1-L3 Subscription Type: Standard Starts: 16/11/18 Ends: 15/11/19 System Type: Physical
- 次のステップは、サブスクリプションを添付することです。
Pool ID
を使用する システムにサブスクリプションをアタッチするために前の手順から取得:# subscription-manager attach --pool=8a85f69c671cb39701671f54cfc365cb
- Redhatサブスクリプションを確認します:
[root@rhel8 ~]# subscription-manager list +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Beta Product ID: 486 Version: 8.0 Beta Arch: x86_64 Status: Subscribed Status Details: Starts: 16/11/18 Ends: 15/11/19
- この段階で、いくつかのデフォルトリポジトリを有効にする必要があります。
dnf
を使用して、有効なリポジトリを一覧表示します コマンド:# dnf repolist Updating Subscription Management repositories. Updating Subscription Management repositories. Last metadata expiration check: 0:01:59 ago on Sat 17 Nov 2018 00:05:40 EST. repo id repo name status rhel-8-for-x86_64-appstream-beta-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs) 4,594 rhel-8-for-x86_64-baseos-beta-rpms
すべてがうまくいけば、
dnf
を使用できるようになります。 Redhat8Linuxシステムに追加のソフトウェアをインストールするコマンド。 - より多くのリポジトリを有効にするには、
subscription-manager
を使用します 最初に、使用可能なすべてのリポジトリとその名前を一覧表示するコマンド:
# subscription-manager repos --list +----------------------------------------------------------+ Available Repositories in /etc/yum.repos.d/redhat.repo +----------------------------------------------------------+ Repo ID: rhel-8-for-x86_64-supplementary-beta-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - Supplementary Beta (RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/supplementary/os Enabled: 0 Repo ID: rhel-8-for-x86_64-baseos-beta-source-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (Source RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/source/SRPMS Enabled: 0 Repo ID: rhel-8-for-x86_64-highavailability-beta-debug-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - High Availability Beta (Debug RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/highavailability/debug Enabled: 0 Repo ID: rhel-8-for-x86_64-rt-beta-debug-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - Real Time Beta (Debug RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/rt/debug Enabled: 0 ....... Repo ID: fast-datapath-beta-for-rhel-8-x86_64-rpms Repo Name: Fast Datapath Beta for RHEL 8 x86_64 (RPMs) Repo URL: https://cdn.redhat.com/content/beta/layered/rhel8/x86_64/fast-datapath/os Enabled: 0 Repo ID: rhel-8-for-x86_64-baseos-beta-debug-rpms Repo Name: Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (Debug RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/baseos/debug Enabled: 0 Repo ID: codeready-builder-beta-for-rhel-8-x86_64-rpms Repo Name: Red Hat CodeReady Linux Builder Beta for RHEL 8 x86_64 (RPMs) Repo URL: https://cdn.redhat.com/content/beta/rhel8/8/x86_64/codeready-builder/os Enabled: 0
リポジトリの
Repo ID
をメモします 有効/無効にします。 -
subscription-manager
を使用してリポジトリを有効/無効にします 指図。この例では、rhel-8-for-x86_64-nfv-beta-rpms
を有効にします。 リポジトリ:# subscription-manager repos --enable=rhel-8-for-x86_64-nfv-beta-rpms Repository 'rhel-8-for-x86_64-nfv-beta-rpms' is enabled for this system.
すべてのリポジトリを有効にするには:
# subscription-manager repos --enable=*
特定のリポジトリを無効にするには、次のコマンドを実行します。
# subscription-manager repos --disable=rhel-8-for-x86_64-nfv-beta-rpms Repository 'rhel-8-for-x86_64-nfv-beta-rpms' is disabled for this system.