Red Hat Enterprise Linix 9 のサブスクリプションを更新する

ConoHa Enterprise Linux 9
このサイトはアフィリエイト広告(Amazonアソシエイト含む)を掲載しています。
スポンサーリンク

ConoHa の VPS に RHEL9 を ISO インストールして早一年ですが、Red Hat Developer Subscription の期限が切れました。更新をしようとしたところ、割とハマったので記録しておきます。

ConoHa に Red Hat Enterprise Linux 9 をインストールする手順
この記事は ConoHa VPS 2.0 API 向けの内容になります。いままでサーバー用は CentOS 一択だったのですが、CentOS が方針転換をしてから状況が一変しました。現在メインで使っている CentOS 7 のサポート期限が...

Red Hat Developer Subscription の有効期限ついて

Red Hat Developer Subscription は登録してから 1 年間有効です。しかし、個人向けの無料の Red Hat Developer Subscription は更新ができず、再度登録するようアナウンスされています。

How to renew your Red Hat Developer Subscription for Individuals | Red Hat Developer
Learn how to renew your no-cost Red Hat Developer Subscription to continue accessing support for Red Hat Enterprise Linu...

更新方法

Red Hat Network にログイン

Red Hat のサイト(https://sso.redhat.com/)にアクセスし、Red Hat Network にログインしてください。

サブスクリプションを確認すると、期限切れになってしまっています。

Developers subscription を再度発行する

Red Hat Developer Program のダウンロードページ(https://developers.redhat.com/products/rhel/download)に移動し、「Activate your subscription」のボタンをクリックしてください。

同意して進むと、先ほどのアカウントページに新しいサブスクリプションが追加されました。

サブスクリプションの再登録とアタッチ

次に、更新をかけるサーバー側で subscription-manager コマンドを使用して操作していきます。

subscription-manager register --force
(out) 登録中: subscription.rhsm.redhat.com:443/subscription
(out) ユーザー名:(Red Hat のユーザー名)
(out) パスワード:(Red Hat のパスワード)
(out) このシステムは、次の ID で登録されました: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
(out) 登録したシステム名: xxxxxxxx
subscription-manager refresh
(out) ローカルデータがすべて更新されました
subscription-manager attach --auto
(out) インストール済み製品の現在の状態:
(out) 製品名: Red Hat Enterprise Linux for x86_64
(out) 状態:   サブスクライブ済み

リポジトリーのエラー

うまくいったように見えましたが、パッケージの更新をしようとしたところエラーで出来ませんでした。

dnf clean all
(out) サブスクリプション管理リポジトリーを更新しています。
(out) 37 ファイルが削除されました
dnf update
(out) サブスクリプション管理リポジトリーを更新しています。
(out) Extra Packages for Enterprise Linux 9 - x86_64                                                                               28 MB/s |  19 MB     00:00
(out) Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64                                                        971  B/s | 2.5 kB     00:02
(out) Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)                                                                    8.1 MB/s |  25 MB     00:03
(out) Errors during downloading metadata for repository 'rhel-9-for-x86_64-appstream-rpms':
(out)   - Status code: 404 for https://cdn.redhat.com/content/dist/rhel9/9/x86_64/appstream/os/repodata/89507edefdfe33c62e0703ba728488b9bf3fdf233b43beec9f9b128bb5b2bde3-comps.xml (IP: 23.32.12.83)
(out) エラー: repo 'rhel-9-for-x86_64-appstream-rpms' のメタデータのダウンロードに失敗しました : Yum repo downloading error: Downloading error(s): repodata/89507edefdfe33c62e0703ba728488b9bf3fdf233b43beec9f9b128bb5b2bde3-comps.xml - Cannot download, all mirrors were already tried without success

サブスクリプションを一旦削除し、再登録

いろいろ試した結果、自分の環境ではアタッチする前に dnf のキャッシュを削除しないとダメでした。

subscription-manager remove --all
(out) 1 件のローカル証明書が削除されました。
(out) サーバーで 1 件のサブスクリプションが削除されました。
subscription-manager unregister
(out) 登録の解除中: subscription.rhsm.redhat.com:443/subscription
(out) システムの登録は解除されました。
subscription-manager clean
(out) ローカルデータがすべて削除されました
subscription-manager register
(out) 登録中: subscription.rhsm.redhat.com:443/subscription
(out) ユーザー名:(Red Hat のユーザー名)
(out) パスワード:(Red Hat のパスワード)
(out) このシステムは、次の ID で登録されました: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
(out) 登録したシステム名: xxxxxxxx
dnf clean all
(out) サブスクリプション管理リポジトリーを更新しています。
(out) 
(out) このシステムは、エンタイトルメントーバーに登録されていますが、更新は受信していません。subscription-manager でサブスクリプションを割り当てることができます。
(out) 
(out) 67 ファイルが削除されました
rm -rf /var/cache/dnf
subscription-manager refresh
(out) ローカルデータがすべて更新されました
subscription-manager attach --auto
(out) インストール済み製品の現在の状態:
(out) 製品名: Red Hat Enterprise Linux for x86_64
(out) 状態:   サブスクライブ済み

これで無事パッケージの更新も問題なくできました。

参考にしたページ

How to renew your Red Hat Developer Subscription for Individuals | Red Hat Developer
Learn how to renew your no-cost Red Hat Developer Subscription to continue accessing support for Red Hat Enterprise Linu...
ConoHa VPS


コメント

タイトルとURLをコピーしました