CentOS Streamを8から9にアップグレードする

CentOS Streamを8から9にアップグレードする

2022-11-30

目次

リポジトリの追加

http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/

上記からCentOS Stream9のリポジトリを確認し、インストールします。

アップグレード実行

アップグレードを実行、失敗する場合は各リポジトリの状態を確認します。

dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync

RPMパッケージのDB再構築とdnfのクリーンアップを実行

rpmdb --rebuilddb
dnf clean all
dnf update -y

必要なコアと最小インストールを行います。

dnf -y groupupdate "Core" "Minimal Install"

インストールできたら再起動

reboot

再起動後にカーネルを確認し、古いカーネルを削除します。

rpm -q kernel-core
    kernel-core-5.14.0-200.el9.x86_64
    kernel-core-4.18.0-408.el8.x86_64
dnf remove -y kernel-core-4.18.0-408.el8.x86_64

モジュールのリセット

いくつかのモジュールが下記のようになっている場合はモジュールのリセットをします。

Problem 1: conflicting requests
  - nothing provides module(platform:el8) needed by module container-tools:rhel8:8070020220921123537:39077419.x86_64
 Problem 2: conflicting requests
  - nothing provides module(platform:el8) needed by module perl-IO-Socket-SSL:2.066:8040020200924212038:1aedcbfe.x86_64
  - nothing provides module(perl:5.26) needed by module perl-IO-Socket-SSL:2.066:8040020200924212038:1aedcbfe.x86_64
 Problem 3: conflicting requests
  - nothing provides module(platform:el8) needed by module perl-libwww-perl:6.34:8040020211102170116:bf75fe78.x86_64
  - nothing provides module(perl:5.26) needed by module perl-libwww-perl:6.34:8040020211102170116:bf75fe78.x86_64
dnf module reset -y container-tools perl-*

subscription-managerの対応

CentOS Stream 9 ではサブスクリプションの登録が必要ないので、

vi /etc/yum/pluginconf.d/subscription-manager.conf

で設定を

[main]
enabled=0

として無効化するか、削除してしまいましょう。

dnf remove -y subscription-manager

アップグレード確認

最後に確認してCentOS Stream 9になっていれば完了。

cat /etc/redhat-release
    CentOS Stream release 9