memo

RHEL

サブスクリプション管理

2024.10.01 現在、SCAにより、サブスクリプションをアタッチしなくても register 時に自動的にサブスクリプション(yumリポジトリ)へのアクセスが可能になるため、以下の attach/remove は不要になり、register/unregister だけでよくなった模様。

サブスクリプションが切れてしまった場合

subscription-manager register を実行すると、新しいサブスクリプションが作成される。
(参考) How to activate your no-cost Red Hat Enterprise Linux subscription
(例)

# Dokcer で RHEL のコンテナを起動
$ docker run -it --rm -v /vagrant:/vagrant --name rh8 registry.access.redhat.com/ubi8/ubi:8.4 /bin/bash
# サブスクリプションを登録 => このコンテナでサブスクリプションを 1つ消費することになるので、後で解除。
$ subscription-manager register --username=hoge --password=pass
Registering to: subscription.rhsm.redhat.com:443/subscription
The system has been registered with ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
The registered system name is: xxxxxxxxxxxx
# このシステム(コンテナ)からサブスクリプションの使用を解除。
$ subscription-manager unregister

(参考)

EPEL