CentOS8からOracle Linux 8への移行2(成功例/非公式手順/EFI環境用


CentOS8からOracle Linux 8への移行(成功例/非公式手順/EFI環境用」として公開したが、いろいろ資料をあたってみると、もうちょっと手順を簡略化できることが分かったので修正版を公開。

(1) CentOS8を用意

CentOS8の最新版を最小インストールで用意した。

[root@centos8 ~]# uname -a
Linux centos8 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@centos8 ~]# dnf list --installed *release*
インストール済みパッケージ
centos-linux-release.noarch               8.3-1.2011.el8               @anaconda
[root@centos8 ~]#

現状の /etc/yum.repos.d/ の中身は下記の状態。

[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 48
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月 10 09:32 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月 10 09:32 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月 10 09:32 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月 10 09:32 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月 10 09:32 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月 10 09:32 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月 10 09:32 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月 10 09:32 CentOS-Linux-Sources.repo
[root@centos8 ~]#

(2) gpgファイルの登録

Oracleサイト上のGPGキーをダウンロードする。

[root@centos8 ~]# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3169  100  3169    0     0   3015      0  0:00:01  0:00:01 --:--:--  3015
[root@centos8 ~]# ls -l /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
-rw-r--r--. 1 root root 3169 12月 11 15:23 /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[root@centos8 ~]#

そして、gpgを登録

[root@centos8 ~]# gpg --import --import-options show-only /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpg: ディレクトリ'/root/.gnupg'が作成されました
gpg: keybox'/root/.gnupg/pubring.kbx'が作成されました
pub   rsa4096 2019-04-09 [SC] [有効期限: 2039-04-04]
      76FD3DB13AB67410B89DB10E82562EA9AD986DA3
uid                      Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
sub   rsa4096 2019-04-09 [E] [有効期限: 2039-04-04]

[root@centos8 ~]#

(3) Oracle Linuxのリリースパッケージをインストールする

dnfコマンドだと競合を無視してインストールがうまく実行できなかったので、ここではrpmコマンドを使ってインストールする。

まずは、BaseOS Latestのパッケージ一覧ページからoraclelinux-release-8.3-1.0.4.el8.x86_64.rpm とredhat-release-8.3-1.0.0.1.el8.x86_64.rpm と、レポジトリ情報が含まれる oraclelinux-release-el8-1.0-14.el8.x86_64.rpm をダウンロードしてくる。

[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73212  100 73212    0     0   247k      0 --:--:-- --:--:-- --:--:--  247k
[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17540  100 17540    0     0   219k      0 --:--:-- --:--:-- --:--:--  219k
[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/oraclelinux-release-el8-1.0-14.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17940  100 17940    0     0   278k      0 --:--:-- --:--:-- --:--:--  278k
[root@centos8 ~]# ls -l *release*
-rw-r--r--. 1 root root 73212 12月 11 15:24 oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
-rw-r--r--. 1 root root 17940 12月 11 15:25 oraclelinux-release-el8-1.0-14.el8.x86_64.rpm
-rw-r--r--. 1 root root 17540 12月 11 15:25 redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
[root@centos8 ~]#

強制インストールを行う

[root@centos8 ~]# rpm -Uvh --force oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm oraclelinux-release-el8-1.0-14.el8.x86_64.rpm redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
警告: oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ad986da3: NOKEY
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:redhat-release-2:8.3-1.0.0.1.el8 ################################# [ 33%]
   2:oraclelinux-release-8:8.3-1.0.4.e################################# [ 67%]
   3:oraclelinux-release-el8-1.0-14.el################################# [100%]
[root@centos8 ~]#

現在インストールされているrelease関連パッケージを確認すると、centos-linux-releaseとかが残っている。

[root@centos8 ~]# rpm -qa|grep release
redhat-release-8.3-1.0.0.1.el8.x86_64
oraclelinux-release-el8-1.0-14.el8.x86_64
centos-linux-release-8.3-1.2011.el8.noarch
oraclelinux-release-8.3-1.0.4.el8.x86_64
[root@centos8 ~]#

(4) CentOSの不要パッケージを削除

centos-linux-release と centos-linux-repos が不要となるので削除する。

いまインストールされているcentosとつくパッケージを確認する。

[root@centos8 ~]# dnf list --installed centos*
インストール済みパッケージ
centos-gpg-keys.noarch                    1:8-2.el8                    @anaconda
centos-linux-release.noarch               8.3-1.2011.el8               @anaconda
centos-linux-repos.noarch                 8-2.el8                      @anaconda
[root@centos8 ~]#

これらを削除する。

[root@centos8 ~]# dnf remove centos-linux-release centos-linux-repos
依存関係が解決しました。
================================================================================
 パッケージ                Arch        バージョン          リポジトリー   サイズ
================================================================================
削除中:
 centos-linux-release      noarch      8.3-1.2011.el8      @anaconda       25 k
 centos-linux-repos        noarch      8-2.el8             @anaconda       26 k
未使用の依存関係の削除:
 centos-gpg-keys           noarch      1:8-2.el8           @anaconda      3.3 k

トランザクションの概要
================================================================================
削除  3 パッケージ

解放された容量: 54 k
これでよろしいですか? [y/N]: y
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  scriptletの実行中: centos-linux-release-8.3-1.2011.el8.noarch             1/1
  削除             : centos-linux-release-8.3-1.2011.el8.noarch             1/3
  削除             : centos-linux-repos-8-2.el8.noarch                      2/3
  削除             : centos-gpg-keys-1:8-2.el8.noarch                       3/3
  scriptletの実行中: centos-gpg-keys-1:8-2.el8.noarch                       3/3
  検証             : centos-gpg-keys-1:8-2.el8.noarch                       1/3
  検証             : centos-linux-release-8.3-1.2011.el8.noarch             2/3
  検証             : centos-linux-repos-8-2.el8.noarch                      3/3

削除しました:
  centos-gpg-keys-1:8-2.el8.noarch   centos-linux-release-8.3-1.2011.el8.noarch
  centos-linux-repos-8-2.el8.noarch

完了しました!
[root@centos8 ~]# dnf list --installed centos*
エラー: 表示するための一致したパッケージはありません
[root@centos8 ~]# rpm -qa|grep centos
[root@centos8 ~]#

(5) インストールされているパッケージを入れ替える

「dnf distro-sync」を実行し、CentOSのパッケージでインストールしたファイルを全てOracle Linuxのパッケージでインストールしたファイルに置き換える。

これにより、/boot/efi/EFI/ ディレクトリ以下にあるCentOS由来ファイルも置き換えることができる。

現在のレポジトリ設定を確認する。

[root@centos8 ~]# dnf repolist
repo id           repo の名前
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
[root@centos8 ~]#

「dnf disto-sync」コマンドを実行して入れ替える。

[root@centos8 ~]# dnf distro-sync
Oracle Linux 8 BaseOS Latest (x86_64)            17 MB/s |  27 MB     00:01
Oracle Linux 8 Application Stream (x86_64)       13 MB/s |  21 MB     00:01
Latest Unbreakable Enterprise Kernel Release 6   11 MB/s |  11 MB     00:00
メタデータの期限切れの最終確認: 0:00:04 時間前の 2020年12月11日 15時31分38秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ           Arch   バージョン                 リポジトリー      サイズ
================================================================================
アップグレード:
 NetworkManager       x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 2.4 M
 NetworkManager-libnm x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 1.8 M
 NetworkManager-team  x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 142 k
 NetworkManager-tui   x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 320 k
 chrony               x86_64 3.5-1.0.1.el8              ol8_baseos_latest 271 k
 coreutils            x86_64 8.30-8.0.1.el8             ol8_baseos_latest 1.2 M
 coreutils-common     x86_64 8.30-8.0.1.el8             ol8_baseos_latest 2.0 M
 dbus                 x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest  41 k
 dbus-common          noarch 1:1.12.8-11.0.1.el8        ol8_baseos_latest  45 k
 dbus-daemon          x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest 240 k
 dbus-libs            x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest 183 k
 dbus-tools           x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest  85 k
 dbxtool              x86_64 8-5.0.1.el8                ol8_baseos_latest  41 k
 dracut               x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest 369 k
 dracut-config-rescue x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest  57 k
 dracut-network       x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest 105 k
 dracut-squash        x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest  58 k
 efi-filesystem       noarch 3-2.0.2.el8                ol8_baseos_latest 9.0 k
 efibootmgr           x86_64 16-1.0.1.el8               ol8_baseos_latest  47 k
 firewalld            noarch 0.8.2-2.0.1.el8            ol8_baseos_latest 487 k
 firewalld-filesystem noarch 0.8.2-2.0.1.el8            ol8_baseos_latest  76 k
 fuse                 x86_64 2.9.7-12.0.2.el8           ol8_baseos_latest  84 k
 fuse-common          x86_64 3.2.1-12.0.2.el8           ol8_baseos_latest  22 k
 fuse-libs            x86_64 2.9.7-12.0.2.el8           ol8_baseos_latest 104 k
 glibc                x86_64 2.28-127.0.1.el8           ol8_baseos_latest 3.6 M
 glibc-common         x86_64 2.28-127.0.1.el8           ol8_baseos_latest 1.3 M
 glibc-langpack-ja    x86_64 2.28-127.0.1.el8           ol8_baseos_latest 330 k
 grub2-common         noarch 1:2.02-90.0.1.el8          ol8_baseos_latest 885 k
 grub2-efi-x64        x86_64 1:2.02-90.0.1.el8          ol8_baseos_latest 409 k
 grub2-tools          x86_64 1:2.02-90.0.1.el8          ol8_baseos_latest 2.0 M
 grub2-tools-extra    x86_64 1:2.02-90.0.1.el8          ol8_baseos_latest 1.1 M
 grub2-tools-minimal  x86_64 1:2.02-90.0.1.el8          ol8_baseos_latest 205 k
 grubby               x86_64 8.40-41.0.1.el8            ol8_baseos_latest  50 k
 iproute              x86_64 5.4.0-1.0.1.el8            ol8_UEKR6         665 k
 iptables             x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest 583 k
 iptables-ebtables    x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest  71 k
 iptables-libs        x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest 106 k
 iwl100-firmware      noarch 999:39.31.5.1-999.5.el8    ol8_baseos_latest 151 k
 iwl1000-firmware     noarch 999:39.31.5.1-999.5.el8    ol8_baseos_latest 215 k
 iwl105-firmware      noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 236 k
 iwl135-firmware      noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 245 k
 iwl2000-firmware     noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 238 k
 iwl2030-firmware     noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 247 k
 iwl3160-firmware     noarch 999:25.30.13.0-999.5.el8   ol8_baseos_latest 1.6 M
 iwl5000-firmware     noarch 999:8.83.5.1_1-999.5.el8   ol8_baseos_latest 295 k
 iwl5150-firmware     noarch 999:8.24.2.2-999.5.el8     ol8_baseos_latest 148 k
 iwl6000-firmware     noarch 999:9.221.4.1-999.5.el8    ol8_baseos_latest 168 k
 iwl6000g2a-firmware  noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 311 k
 iwl6050-firmware     noarch 999:41.28.5.1-999.5.el8    ol8_baseos_latest 244 k
 iwl7260-firmware     noarch 999:25.30.13.0-999.5.el8   ol8_baseos_latest  15 M
 kexec-tools          x86_64 2.0.20-34.0.2.el8          ol8_baseos_latest 498 k
 kmod                 x86_64 25-16.0.1.el8              ol8_baseos_latest 128 k
 kmod-libs            x86_64 25-16.0.1.el8              ol8_baseos_latest  70 k
 libdnf               x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 650 k
 libgcc               x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest  85 k
 libgomp              x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest 211 k
 libkcapi             x86_64 1.2.0-2.0.1.el8            ol8_baseos_latest  48 k
 libkcapi-hmaccalc    x86_64 1.2.0-2.0.1.el8            ol8_baseos_latest  31 k
 libreport-filesystem x86_64 2.9.5-15.0.1.el8           ol8_baseos_latest  22 k
 libsss_autofs        x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 108 k
 libsss_certmap       x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 141 k
 libsss_idmap         x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 111 k
 libsss_nss_idmap     x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 118 k
 libsss_sudo          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 107 k
 libstdc++            x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest 458 k
 libxml2              x86_64 2.9.7-8.0.1.el8            ol8_baseos_latest 696 k
 libxslt              x86_64 1.1.32-5.0.1.el8           ol8_baseos_latest 250 k
 libzstd              x86_64 1.4.4-1.0.1.el8            ol8_baseos_latest 266 k
 linux-firmware       noarch 999:20200902-999.5.gitd5f9eea5.el8
                                                        ol8_baseos_latest 122 M
 microcode_ctl        x86_64 4:20200609-2.20201027.1.0.1.el8_3
                                                        ol8_baseos_latest 4.5 M
 mozjs60              x86_64 60.9.0-4.0.1.el8           ol8_baseos_latest 6.6 M
 open-vm-tools        x86_64 11.1.0-2.0.1.el8           ol8_appstream     716 k
 os-prober            x86_64 1.74-6.0.1.el8             ol8_baseos_latest  51 k
 parted               x86_64 3.2-38.0.1.el8             ol8_baseos_latest 556 k
 platform-python      x86_64 3.6.8-31.0.1.el8           ol8_baseos_latest  83 k
 plymouth             x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream     127 k
 plymouth-core-libs   x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream     122 k
 plymouth-scripts     x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream      44 k
 policycoreutils      x86_64 2.9-9.0.1.el8              ol8_baseos_latest 377 k
 polkit               x86_64 0.115-11.0.1.el8           ol8_baseos_latest 154 k
 polkit-libs          x86_64 0.115-11.0.1.el8           ol8_baseos_latest  76 k
 python3-firewall     noarch 0.8.2-2.0.1.el8            ol8_baseos_latest 392 k
 python3-hawkey       x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 112 k
 python3-libdnf       x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 757 k
 python3-libs         x86_64 3.6.8-31.0.1.el8           ol8_baseos_latest 7.8 M
 python3-libxml2      x86_64 2.9.7-8.0.1.el8            ol8_baseos_latest 237 k
 selinux-policy       noarch 3.14.3-54.0.1.el8          ol8_baseos_latest 623 k
 selinux-policy-targeted
                      noarch 3.14.3-54.0.1.el8          ol8_baseos_latest  15 M
 sssd-client          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 171 k
 sssd-common          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 1.5 M
 sssd-kcm             x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 224 k
 sssd-nfs-idmap       x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 105 k
 systemd              x86_64 239-41.0.1.el8_3           ol8_baseos_latest 3.6 M
 systemd-libs         x86_64 239-41.0.1.el8_3           ol8_baseos_latest 1.1 M
 systemd-pam          x86_64 239-41.0.1.el8_3           ol8_baseos_latest 457 k
 systemd-udev         x86_64 239-41.0.1.el8_3           ol8_baseos_latest 1.3 M
 tuned                noarch 2.14.0-3.0.1.el8           ol8_baseos_latest 294 k
 vim-minimal          x86_64 2:8.0.1763-15.0.1.el8      ol8_baseos_latest 572 k
 xfsprogs             x86_64 5.4.0-1.0.1.el8            ol8_UEKR6         1.1 M
再インストール:
 acl                  x86_64 2.2.53-1.el8               ol8_baseos_latest  81 k
 audit                x86_64 3.0-0.17.20191104git1c2f876.el8
                                                        ol8_baseos_latest 254 k
 audit-libs           x86_64 3.0-0.17.20191104git1c2f876.el8
                                                        ol8_baseos_latest 116 k
 authselect           x86_64 1.2.1-2.el8                ol8_baseos_latest 115 k
 authselect-libs      x86_64 1.2.1-2.el8                ol8_baseos_latest 211 k
 basesystem           noarch 11-5.el8                   ol8_baseos_latest  10 k
 bash                 x86_64 4.4.19-12.el8              ol8_baseos_latest 1.5 M
 bind-export-libs     x86_64 32:9.11.20-5.el8           ol8_baseos_latest 1.1 M
 biosdevname          x86_64 0.7.3-2.el8                ol8_baseos_latest  44 k
 brotli               x86_64 1.0.6-2.el8                ol8_baseos_latest 322 k
 bzip2-libs           x86_64 1.0.6-26.el8               ol8_baseos_latest  48 k
 c-ares               x86_64 1.13.0-5.el8               ol8_baseos_latest  93 k
 ca-certificates      noarch 2020.2.41-80.0.el8_2       ol8_baseos_latest 391 k
 chkconfig            x86_64 1.13-2.el8                 ol8_baseos_latest 194 k
 cpio                 x86_64 2.12-8.el8                 ol8_baseos_latest 265 k
 cracklib             x86_64 2.9.6-15.el8               ol8_baseos_latest  93 k
 cracklib-dicts       x86_64 2.9.6-15.el8               ol8_baseos_latest 4.0 M
 cronie               x86_64 1.5.2-4.el8                ol8_baseos_latest 119 k
 cronie-anacron       x86_64 1.5.2-4.el8                ol8_baseos_latest  42 k
 crontabs             noarch 1.11-16.20150630git.el8    ol8_baseos_latest  25 k
 crypto-policies      noarch 20200713-1.git51d1222.el8  ol8_baseos_latest  62 k
 crypto-policies-scripts
                      noarch 20200713-1.git51d1222.el8  ol8_baseos_latest  67 k
 cryptsetup-libs      x86_64 2.3.3-2.el8                ol8_baseos_latest 470 k
 curl                 x86_64 7.61.1-14.el8              ol8_baseos_latest 353 k
 cyrus-sasl-lib       x86_64 2.1.27-5.el8               ol8_baseos_latest 123 k
 dbus-glib            x86_64 0.110-2.el8                ol8_baseos_latest 127 k
 device-mapper        x86_64 8:1.02.171-5.el8           ol8_baseos_latest 373 k
 device-mapper-event  x86_64 8:1.02.171-5.el8           ol8_baseos_latest 268 k
 device-mapper-event-libs
                      x86_64 8:1.02.171-5.el8           ol8_baseos_latest 267 k
 device-mapper-libs   x86_64 8:1.02.171-5.el8           ol8_baseos_latest 406 k
 device-mapper-persistent-data
                      x86_64 0.8.5-4.el8                ol8_baseos_latest 468 k
 dhcp-client          x86_64 12:4.3.6-41.el8            ol8_baseos_latest 318 k
 dhcp-common          noarch 12:4.3.6-41.el8            ol8_baseos_latest 207 k
 dhcp-libs            x86_64 12:4.3.6-41.el8            ol8_baseos_latest 147 k
 diffutils            x86_64 3.6-6.el8                  ol8_baseos_latest 361 k
 dmidecode            x86_64 1:3.2-6.el8                ol8_baseos_latest  91 k
 dnf                  noarch 4.2.23-4.el8               ol8_baseos_latest 513 k
 dnf-data             noarch 4.2.23-4.el8               ol8_baseos_latest 149 k
 dnf-plugins-core     noarch 4.0.17-5.el8               ol8_baseos_latest  66 k
 dosfstools           x86_64 4.1-6.el8                  ol8_baseos_latest 122 k
 e2fsprogs            x86_64 1.45.6-1.el8               ol8_baseos_latest 1.0 M
 e2fsprogs-libs       x86_64 1.45.6-1.el8               ol8_baseos_latest 233 k
 efivar               x86_64 37-4.el8                   ol8_baseos_latest  36 k
 efivar-libs          x86_64 37-4.el8                   ol8_baseos_latest 108 k
 elfutils-debuginfod-client
                      x86_64 0.180-1.el8                ol8_baseos_latest  64 k
 elfutils-default-yama-scope
                      noarch 0.180-1.el8                ol8_baseos_latest  49 k
 elfutils-libelf      x86_64 0.180-1.el8                ol8_baseos_latest 214 k
 elfutils-libs        x86_64 0.180-1.el8                ol8_baseos_latest 293 k
 ethtool              x86_64 2:5.0-2.el8                ol8_baseos_latest 151 k
 expat                x86_64 2.2.5-4.el8                ol8_baseos_latest 111 k
 file                 x86_64 5.33-16.el8                ol8_baseos_latest  76 k
 file-libs            x86_64 5.33-16.el8                ol8_baseos_latest 542 k
 filesystem           x86_64 3.8-3.el8                  ol8_baseos_latest 1.1 M
 findutils            x86_64 1:4.6.0-20.el8             ol8_baseos_latest 528 k
 freetype             x86_64 2.9.1-4.el8_3.1            ol8_baseos_latest 394 k
 gawk                 x86_64 4.2.1-1.el8                ol8_baseos_latest 1.1 M
 gdbm                 x86_64 1:1.18-1.el8               ol8_baseos_latest 130 k
 gdbm-libs            x86_64 1:1.18-1.el8               ol8_baseos_latest  60 k
 geolite2-city        noarch 20180605-1.el8             ol8_appstream      19 M
 geolite2-country     noarch 20180605-1.el8             ol8_appstream     1.0 M
 gettext              x86_64 0.19.8.1-17.el8            ol8_baseos_latest 1.1 M
 gettext-libs         x86_64 0.19.8.1-17.el8            ol8_baseos_latest 312 k
 glib2                x86_64 2.56.4-8.el8               ol8_baseos_latest 2.5 M
 gmp                  x86_64 1:6.1.2-10.el8             ol8_baseos_latest 321 k
 gnupg2               x86_64 2.2.20-2.el8               ol8_baseos_latest 2.4 M
 gnupg2-smime         x86_64 2.2.20-2.el8               ol8_baseos_latest 283 k
 gnutls               x86_64 3.6.14-6.el8               ol8_baseos_latest 1.0 M
 gobject-introspection
                      x86_64 1.56.1-1.el8               ol8_baseos_latest 255 k
 gpgme                x86_64 1.13.1-3.el8               ol8_baseos_latest 335 k
 grep                 x86_64 3.1-6.el8                  ol8_baseos_latest 274 k
 groff-base           x86_64 1.22.3-18.el8              ol8_baseos_latest 1.0 M
 gzip                 x86_64 1.9-9.el8                  ol8_baseos_latest 167 k
 hardlink             x86_64 1:1.3-6.el8                ol8_baseos_latest  29 k
 hdparm               x86_64 9.54-2.el8                 ol8_baseos_latest 100 k
 hostname             x86_64 3.20-6.el8                 ol8_baseos_latest  32 k
 hwdata               noarch 0.314-8.6.el8              ol8_baseos_latest 1.6 M
 ima-evm-utils        x86_64 1.1-5.el8                  ol8_baseos_latest  55 k
 info                 x86_64 6.5-6.el8                  ol8_baseos_latest 198 k
 initscripts          x86_64 10.00.9-1.el8              ol8_baseos_latest 338 k
 ipcalc               x86_64 0.2.4-4.el8                ol8_baseos_latest  38 k
 iprutils             x86_64 2.4.19-1.el8               ol8_baseos_latest 255 k
 ipset                x86_64 7.1-1.el8                  ol8_baseos_latest  45 k
 ipset-libs           x86_64 7.1-1.el8                  ol8_baseos_latest  71 k
 iputils              x86_64 20180629-2.el8             ol8_baseos_latest 149 k
 irqbalance           x86_64 2:1.4.0-4.el8              ol8_baseos_latest  55 k
 jansson              x86_64 2.11-3.el8                 ol8_baseos_latest  46 k
 json-c               x86_64 0.13.1-0.2.el8             ol8_baseos_latest  40 k
 kbd                  x86_64 2.0.4-10.el8               ol8_baseos_latest 390 k
 kbd-legacy           noarch 2.0.4-10.el8               ol8_baseos_latest 481 k
 kbd-misc             noarch 2.0.4-10.el8               ol8_baseos_latest 1.5 M
 kernel               x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest 4.3 M
 kernel-core          x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest  30 M
 kernel-modules       x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest  26 M
 kernel-tools         x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest 4.5 M
 kernel-tools-libs    x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest 4.3 M
 keyutils-libs        x86_64 1.5.10-6.el8               ol8_baseos_latest  34 k
 kpartx               x86_64 0.8.4-5.el8                ol8_baseos_latest 108 k
 krb5-libs            x86_64 1.18.2-5.el8               ol8_baseos_latest 837 k
 langpacks-ja         noarch 1.0-12.el8                 ol8_appstream     9.5 k
 less                 x86_64 530-1.el8                  ol8_baseos_latest 164 k
 libacl               x86_64 2.2.53-1.el8               ol8_baseos_latest  35 k
 libaio               x86_64 0.3.112-1.el8              ol8_baseos_latest  33 k
 libarchive           x86_64 3.3.2-9.el8                ol8_baseos_latest 358 k
 libassuan            x86_64 2.5.1-3.el8                ol8_baseos_latest  83 k
 libattr              x86_64 2.4.48-3.el8               ol8_baseos_latest  27 k
 libbasicobjects      x86_64 0.1.1-39.el8               ol8_baseos_latest  31 k
 libblkid             x86_64 2.32.1-24.el8              ol8_baseos_latest 216 k
 libcap               x86_64 2.26-4.el8                 ol8_baseos_latest  60 k
 libcap-ng            x86_64 0.7.9-5.el8                ol8_baseos_latest  33 k
 libcollection        x86_64 0.7.0-39.el8               ol8_baseos_latest  48 k
 libcom_err           x86_64 1.45.6-1.el8               ol8_baseos_latest  49 k
 libcomps             x86_64 0.1.11-4.el8               ol8_baseos_latest  81 k
 libcroco             x86_64 0.6.12-4.el8_2.1           ol8_baseos_latest 113 k
 libcurl              x86_64 7.61.1-14.el8              ol8_baseos_latest 298 k
 libdaemon            x86_64 0.14-15.el8                ol8_baseos_latest  36 k
 libdb                x86_64 5.3.28-39.el8              ol8_baseos_latest 750 k
 libdb-utils          x86_64 5.3.28-39.el8              ol8_baseos_latest 149 k
 libdhash             x86_64 0.5.0-39.el8               ol8_baseos_latest  34 k
 libdrm               x86_64 2.4.101-1.el8              ol8_appstream     165 k
 libedit              x86_64 3.1-23.20170329cvs.el8     ol8_baseos_latest 102 k
 libestr              x86_64 0.1.10-1.el8               ol8_appstream      27 k
 libevent             x86_64 2.1.8-5.el8                ol8_baseos_latest 253 k
 libfastjson          x86_64 0.99.8-2.el8               ol8_appstream      37 k
 libfdisk             x86_64 2.32.1-24.el8              ol8_baseos_latest 249 k
 libffi               x86_64 3.1-22.el8                 ol8_baseos_latest  37 k
 libgcrypt            x86_64 1.8.5-4.el8                ol8_baseos_latest 462 k
 libgpg-error         x86_64 1.31-1.el8                 ol8_baseos_latest 242 k
 libidn2              x86_64 2.2.0-1.el8                ol8_baseos_latest  94 k
 libini_config        x86_64 1.3.1-39.el8               ol8_baseos_latest  70 k
 libksba              x86_64 1.3.5-7.el8                ol8_baseos_latest 135 k
 libldb               x86_64 2.1.3-2.el8                ol8_baseos_latest 178 k
 libmaxminddb         x86_64 1.2.0-10.el8               ol8_appstream      33 k
 libmetalink          x86_64 0.1.3-7.el8                ol8_baseos_latest  32 k
 libmnl               x86_64 1.0.4-6.el8                ol8_baseos_latest  30 k
 libmodulemd          x86_64 2.9.4-2.el8                ol8_baseos_latest 189 k
 libmount             x86_64 2.32.1-24.el8              ol8_baseos_latest 232 k
 libmspack            x86_64 0.7-0.3.alpha.el8.4        ol8_appstream      71 k
 libndp               x86_64 1.7-3.el8                  ol8_baseos_latest  41 k
 libnetfilter_conntrack
                      x86_64 1.0.6-5.el8                ol8_baseos_latest  65 k
 libnfnetlink         x86_64 1.0.1-13.el8               ol8_baseos_latest  33 k
 libnfsidmap          x86_64 1:2.3.3-35.el8             ol8_baseos_latest 119 k
 libnftnl             x86_64 1.1.5-4.el8                ol8_baseos_latest  83 k
 libnghttp2           x86_64 1.33.0-3.el8_2.1           ol8_baseos_latest  77 k
 libnl3               x86_64 3.5.0-1.el8                ol8_baseos_latest 323 k
 libnl3-cli           x86_64 3.5.0-1.el8                ol8_baseos_latest 197 k
 libnsl2              x86_64 1.2.0-2.20180605git4a062cf.el8
                                                        ol8_baseos_latest  58 k
 libpath_utils        x86_64 0.2.1-39.el8               ol8_baseos_latest  34 k
 libpcap              x86_64 14:1.9.1-4.el8             ol8_baseos_latest 166 k
 libpciaccess         x86_64 0.14-1.el8                 ol8_baseos_latest  32 k
 libpipeline          x86_64 1.5.0-2.el8                ol8_baseos_latest  54 k
 libpng               x86_64 2:1.6.34-5.el8             ol8_baseos_latest 126 k
 libpsl               x86_64 0.20.2-6.el8               ol8_baseos_latest  61 k
 libpwquality         x86_64 1.4.0-9.el8                ol8_baseos_latest 102 k
 libref_array         x86_64 0.1.5-39.el8               ol8_baseos_latest  33 k
 librepo              x86_64 1.12.0-2.el8               ol8_baseos_latest  90 k
 libseccomp           x86_64 2.4.3-1.el8                ol8_baseos_latest  67 k
 libsecret            x86_64 0.18.6-1.el8               ol8_baseos_latest 163 k
 libselinux           x86_64 2.9-4.el8_3                ol8_baseos_latest 165 k
 libselinux-utils     x86_64 2.9-4.el8_3                ol8_baseos_latest 243 k
 libsemanage          x86_64 2.9-3.el8                  ol8_baseos_latest 165 k
 libsepol             x86_64 2.9-1.el8                  ol8_baseos_latest 339 k
 libsigsegv           x86_64 2.11-5.el8                 ol8_baseos_latest  30 k
 libsmartcols         x86_64 2.32.1-24.el8              ol8_baseos_latest 175 k
 libsolv              x86_64 0.7.11-1.el8               ol8_baseos_latest 358 k
 libss                x86_64 1.45.6-1.el8               ol8_baseos_latest  53 k
 libssh               x86_64 0.9.4-2.el8                ol8_baseos_latest 215 k
 libssh-config        noarch 0.9.4-2.el8                ol8_baseos_latest  18 k
 libsysfs             x86_64 2.1.0-24.el8               ol8_baseos_latest  53 k
 libtalloc            x86_64 2.3.1-2.el8                ol8_baseos_latest  49 k
 libtasn1             x86_64 4.13-3.el8                 ol8_baseos_latest  76 k
 libtdb               x86_64 1.4.3-1.el8                ol8_baseos_latest  59 k
 libteam              x86_64 1.31-2.el8                 ol8_baseos_latest  64 k
 libtevent            x86_64 0.10.2-2.el8               ol8_baseos_latest  49 k
 libtirpc             x86_64 1.1.4-4.el8                ol8_baseos_latest 112 k
 libtool-ltdl         x86_64 2.4.6-25.el8               ol8_baseos_latest  58 k
 libunistring         x86_64 0.9.9-3.el8                ol8_baseos_latest 422 k
 libusbx              x86_64 1.0.23-4.el8               ol8_baseos_latest  74 k
 libuser              x86_64 0.62-23.el8                ol8_baseos_latest 417 k
 libutempter          x86_64 1.1.6-14.el8               ol8_baseos_latest  32 k
 libuuid              x86_64 2.32.1-24.el8              ol8_baseos_latest  95 k
 libverto             x86_64 0.3.0-5.el8                ol8_baseos_latest  24 k
 libxcrypt            x86_64 4.1.1-4.el8                ol8_baseos_latest  73 k
 libxkbcommon         x86_64 0.9.1-1.el8                ol8_appstream     116 k
 libyaml              x86_64 0.1.7-5.el8                ol8_baseos_latest  61 k
 logrotate            x86_64 3.14.0-4.el8               ol8_baseos_latest  86 k
 lshw                 x86_64 B.02.19.2-2.el8            ol8_baseos_latest 341 k
 lsscsi               x86_64 0.30-1.el8                 ol8_baseos_latest  69 k
 lua-libs             x86_64 5.3.4-11.el8               ol8_baseos_latest 118 k
 lvm2                 x86_64 8:2.03.09-5.el8            ol8_baseos_latest 1.6 M
 lvm2-libs            x86_64 8:2.03.09-5.el8            ol8_baseos_latest 1.1 M
 lz4-libs             x86_64 1.8.3-2.el8                ol8_baseos_latest  66 k
 lzo                  x86_64 2.08-14.el8                ol8_baseos_latest  69 k
 man-db               x86_64 2.7.6.1-17.el8             ol8_baseos_latest 887 k
 memstrack            x86_64 0.1.11-1.el8               ol8_baseos_latest  48 k
 mokutil              x86_64 1:0.3.0-10.el8             ol8_baseos_latest  45 k
 mpfr                 x86_64 3.1.6-1.el8                ol8_baseos_latest 221 k
 ncurses              x86_64 6.1-7.20180224.el8         ol8_baseos_latest 387 k
 ncurses-base         noarch 6.1-7.20180224.el8         ol8_baseos_latest  81 k
 ncurses-libs         x86_64 6.1-7.20180224.el8         ol8_baseos_latest 335 k
 nettle               x86_64 3.4.1-2.el8                ol8_baseos_latest 300 k
 newt                 x86_64 0.52.20-11.el8             ol8_baseos_latest 122 k
 nftables             x86_64 1:0.9.3-16.el8             ol8_baseos_latest 312 k
 npth                 x86_64 1.5-4.el8                  ol8_baseos_latest  26 k
 numactl-libs         x86_64 2.0.12-11.el8              ol8_baseos_latest  36 k
 openldap             x86_64 2.4.46-15.el8              ol8_baseos_latest 351 k
 openssh              x86_64 8.0p1-5.el8                ol8_baseos_latest 521 k
 openssh-clients      x86_64 8.0p1-5.el8                ol8_baseos_latest 666 k
 openssh-server       x86_64 8.0p1-5.el8                ol8_baseos_latest 483 k
 openssl              x86_64 1:1.1.1g-11.el8            ol8_baseos_latest 706 k
 openssl-libs         x86_64 1:1.1.1g-11.el8            ol8_baseos_latest 1.5 M
 openssl-pkcs11       x86_64 0.4.10-2.el8               ol8_baseos_latest  66 k
 p11-kit              x86_64 0.23.14-5.el8_0            ol8_baseos_latest 272 k
 p11-kit-trust        x86_64 0.23.14-5.el8_0            ol8_baseos_latest 139 k
 pam                  x86_64 1.3.1-11.el8               ol8_baseos_latest 738 k
 passwd               x86_64 0.80-3.el8                 ol8_baseos_latest 115 k
 pciutils             x86_64 3.6.4-2.el8                ol8_baseos_latest 102 k
 pciutils-libs        x86_64 3.6.4-2.el8                ol8_baseos_latest  54 k
 pcre                 x86_64 8.42-4.el8                 ol8_baseos_latest 208 k
 pcre2                x86_64 10.32-2.el8                ol8_baseos_latest 246 k
 pigz                 x86_64 2.4-4.el8                  ol8_baseos_latest  80 k
 pinentry             x86_64 1.1.0-2.el8                ol8_appstream     100 k
 platform-python-pip  noarch 9.0.3-18.el8               ol8_baseos_latest 1.7 M
 platform-python-setuptools
                      noarch 39.2.0-6.el8               ol8_baseos_latest 631 k
 polkit-pkla-compat   x86_64 0.1-12.el8                 ol8_baseos_latest  46 k
 popt                 x86_64 1.16-14.el8                ol8_baseos_latest  61 k
 prefixdevname        x86_64 0.1.0-6.el8                ol8_baseos_latest 427 k
 procps-ng            x86_64 3.3.15-3.el8               ol8_baseos_latest 328 k
 publicsuffix-list-dafsa
                      noarch 20180723-1.el8             ol8_baseos_latest  56 k
 python3-configobj    noarch 5.0.6-11.el8               ol8_baseos_latest  68 k
 python3-dateutil     noarch 1:2.6.1-6.el8              ol8_baseos_latest 251 k
 python3-dbus         x86_64 1.2.4-15.el8               ol8_baseos_latest 134 k
 python3-decorator    noarch 4.2.1-2.el8                ol8_baseos_latest  27 k
 python3-dmidecode    x86_64 3.12.2-15.el8              ol8_baseos_latest  94 k
 python3-dnf          noarch 4.2.23-4.el8               ol8_baseos_latest 526 k
 python3-dnf-plugins-core
                      noarch 4.0.17-5.el8               ol8_baseos_latest 221 k
 python3-gobject-base x86_64 3.28.3-2.el8               ol8_baseos_latest 313 k
 python3-gpg          x86_64 1.13.1-3.el8               ol8_baseos_latest 244 k
 python3-libcomps     x86_64 0.1.11-4.el8               ol8_baseos_latest  52 k
 python3-libselinux   x86_64 2.9-4.el8_3                ol8_baseos_latest 283 k
 python3-linux-procfs noarch 0.6.2-2.el8                ol8_baseos_latest  42 k
 python3-nftables     x86_64 1:0.9.3-16.el8             ol8_baseos_latest  26 k
 python3-perf         x86_64 4.18.0-240.1.1.el8_3       ol8_baseos_latest 4.4 M
 python3-pip-wheel    noarch 9.0.3-18.el8               ol8_baseos_latest 1.0 M
 python3-pyudev       noarch 0.21.0-7.el8               ol8_baseos_latest  84 k
 python3-rpm          x86_64 4.14.3-4.el8               ol8_baseos_latest 157 k
 python3-schedutils   x86_64 0.6-6.el8                  ol8_baseos_latest  29 k
 python3-setuptools-wheel
                      noarch 39.2.0-6.el8               ol8_baseos_latest 287 k
 python3-six          noarch 1.11.0-8.el8               ol8_baseos_latest  38 k
 python3-slip         noarch 0.6.4-11.el8               ol8_baseos_latest  38 k
 python3-slip-dbus    noarch 0.6.4-11.el8               ol8_baseos_latest  39 k
 python3-unbound      x86_64 1.7.3-14.el8               ol8_appstream     118 k
 readline             x86_64 7.0-10.el8                 ol8_baseos_latest 199 k
 rng-tools            x86_64 6.8-3.el8                  ol8_baseos_latest  59 k
 rootfiles            noarch 8.1-22.el8                 ol8_baseos_latest  13 k
 rpm                  x86_64 4.14.3-4.el8               ol8_baseos_latest 541 k
 rpm-build-libs       x86_64 4.14.3-4.el8               ol8_baseos_latest 154 k
 rpm-libs             x86_64 4.14.3-4.el8               ol8_baseos_latest 338 k
 rpm-plugin-selinux   x86_64 4.14.3-4.el8               ol8_baseos_latest  75 k
 rpm-plugin-systemd-inhibit
                      x86_64 4.14.3-4.el8               ol8_baseos_latest  76 k
 rsyslog              x86_64 8.1911.0-6.el8             ol8_appstream     732 k
 sed                  x86_64 4.5-2.el8                  ol8_baseos_latest 298 k
 setup                noarch 2.12.2-6.el8               ol8_baseos_latest 181 k
 sg3_utils            x86_64 1.44-5.el8                 ol8_baseos_latest 917 k
 sg3_utils-libs       x86_64 1.44-5.el8                 ol8_baseos_latest  99 k
 shadow-utils         x86_64 2:4.6-11.el8               ol8_baseos_latest 1.2 M
 shared-mime-info     x86_64 1.9-3.el8                  ol8_baseos_latest 328 k
 slang                x86_64 2.3.2-3.el8                ol8_baseos_latest 368 k
 snappy               x86_64 1.1.8-3.el8                ol8_baseos_latest  37 k
 sqlite-libs          x86_64 3.26.0-11.el8              ol8_baseos_latest 580 k
 squashfs-tools       x86_64 4.3-19.el8                 ol8_baseos_latest 165 k
 sudo                 x86_64 1.8.29-6.el8               ol8_baseos_latest 923 k
 tar                  x86_64 2:1.30-5.el8               ol8_baseos_latest 838 k
 teamd                x86_64 1.31-2.el8                 ol8_baseos_latest 130 k
 timedatex            x86_64 0.5-3.el8                  ol8_baseos_latest  32 k
 trousers             x86_64 0.3.14-4.el8               ol8_baseos_latest 153 k
 trousers-lib         x86_64 0.3.14-4.el8               ol8_baseos_latest 168 k
 tzdata               noarch 2020d-1.el8                ol8_baseos_latest 471 k
 unbound-libs         x86_64 1.7.3-14.el8               ol8_appstream     500 k
 util-linux           x86_64 2.32.1-24.el8              ol8_baseos_latest 2.5 M
 virt-what            x86_64 1.18-6.el8                 ol8_baseos_latest  35 k
 which                x86_64 2.21-12.el8                ol8_baseos_latest  49 k
 xkeyboard-config     noarch 2.28-1.el8                 ol8_appstream     782 k
 xmlsec1              x86_64 1.2.25-4.el8               ol8_appstream     191 k
 xmlsec1-openssl      x86_64 1.2.25-4.el8               ol8_appstream      94 k
 xz                   x86_64 5.2.4-3.el8                ol8_baseos_latest 153 k
 xz-libs              x86_64 5.2.4-3.el8                ol8_baseos_latest  94 k
 yum                  noarch 4.2.23-4.el8               ol8_baseos_latest 192 k
 zlib                 x86_64 1.2.11-16.el8_2            ol8_baseos_latest 102 k
依存関係のインストール:
 grub2-tools-efi      x86_64 1:2.02-90.0.1.el8          ol8_baseos_latest 470 k
ダウングレード:
 shim-x64             x86_64 15-11.0.5                  ol8_baseos_latest 656 k

トランザクションの概要
================================================================================
インストール     1 パッケージ
アップグレード  99 パッケージ
ダウングレード   1 パッケージ

ダウンロードサイズの合計: 389 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/389): acl-2.2.53-1.el8.x86_64.rpm            724 kB/s |  81 kB     00:00
<略>
(389/389): linux-firmware-20200902-999.5.gitd5f  19 MB/s | 122 MB     00:06
--------------------------------------------------------------------------------
合計                                             25 MB/s | 389 MB     00:15
警告: /var/cache/dnf/ol8_baseos_latest-e4c6155830ad002c/packages/shim-x64-15-11.0.5.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ad986da3: NOKEY
Oracle Linux 8 BaseOS Latest (x86_64)           3.0 MB/s | 3.1 kB     00:00
GPG 鍵 0xAD986DA3 をインポート中:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
トランザクションの確認を実行中
<略>


(6) grub.conf の作成

grub2関連ファイルがちゃんと出来ているかを確認します。

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx------. 1 root root 1216760  7月 25 03:42 BOOTX64.EFI
-rwx------. 1 root root  361600  7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx------. 1 root root 6544 12月 11 15:17 grub.cfg
-rwx------. 1 root root 1024 12月 11 15:20 grubenv

/boot/efi/EFI/redhat:
合計 4196
-rwx------. 1 root root     134  7月 25 03:42 BOOTX64.CSV
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    1024 12月 11 15:38 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
-rwx------. 1 root root 1165032  7月 25 03:42 mmx64.efi
-rwx------. 1 root root 1216760  7月 25 03:42 shimx64.efi
[root@centos8 ~]#

/etc/grub2-efi.cfg のリンク先が無いですね。

grub2-mkconfigコマンドで作成します。

[root@centos8 ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for EFI firmware configuration
done
[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx------. 1 root root 1216760  7月 25 03:42 BOOTX64.EFI
-rwx------. 1 root root  361600  7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx------. 1 root root 6544 12月 11 15:17 grub.cfg
-rwx------. 1 root root 1024 12月 11 15:20 grubenv

/boot/efi/EFI/redhat:
合計 4204
-rwx------. 1 root root     134  7月 25 03:42 BOOTX64.CSV
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    6544 12月 11 15:41 grub.cfg
-rwx------. 1 root root    1024 12月 11 15:41 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
-rwx------. 1 root root 1165032  7月 25 03:42 mmx64.efi
-rwx------. 1 root root 1216760  7月 25 03:42 shimx64.efi
[root@centos8 ~]#

(9) 再起動

サーバを再起動します。

Oracle Linuxで起動してきます。

Oracle Autonomous Linuxでレポジトリ仕様の変更があった


Oracle Cloud上のFree Tierインスタンスとして、Oracle Autonomous Linux 7を使っている。

そうしたら、下記のメールが届いた。

画像

いままで使っていたレポジトリ「al7」が廃止されて、現在有効なレポジトリはコレです、といままではなかった「ol7_~」というレポジトリがたくさん…

お知らせを探して見たところ「Oracle Cloud Infrastructure Documentation」→「Compute」→「Oracle-Provided Images」にて「Oracle-Provided Image Release Notes」というページが紹介されている。

この「All Images Familes」のOracle Autonomous Linux 7.xの項目をみると、2020/12/09付けで「Oracle-Autonomous-Linux-7.9-2020.12-0」がリリースされていた。

OS configured to use the standard Oracle Linux yum repositories. The Autonomous Linux repository (al7) is deprecated and all customers with existing Oracle Autonomous Linux instances are migrated to the new repositories automatically. For more information, see Linux Image Details.

上記にあるように、Autonomous Linux レポジトリ(al7)が廃止され、通常のOracle Linuxレポジトリに統合されました、とのこと。

詳細は「Linux Image Details→Oracle Autonomous Linux」に記載されているが、下記のレポジトリがal7からの移行対象とのこと。

ol7_UEKR6
ol7_addons
ol7_ksplice
ol7_latest
ol7_oci_included
ol7_optional_latest
ol7_software_collections
ol7_x86_64_userspace_ksplice

ol7_developer と ol7_developer_EPEL は、開発用なんだから運用向けのAutonomous Linuxで必要なわけないだろ、的な感じである。

今回の変更で、通常のOracle Linuxとの差がだいぶなくなったので使いやすくはなりましたね。

CentOS8からOracle Linux 8への移行1(非推奨/別記事参照のこと


いろいろ試していたら、よりよい手順があったため「CentOS8からOracle Linux 8への移行2(成功例/非公式手順/EFI環境用」として更新した。


CentOS8がRHEL8の組み替え版であることをやめ、RHEL8の先行開発版であるCentOS Stream版のみになる、という発表が騒がしている。(CentOS Project shifts focus to CentOS Stream)

いまのところはOracle Linuxがどうなるかは発表ないけど、たぶん、商売的には相変わらずpublic yumも公開し続けてくれるんじゃないかなーと思うので、CentOS8からOracleLinux8に移行できるか確認。

2020/12/10時点ではOracle Linux公式手法としてCentOS8からOracle Linux8への移行手法は公開していない。

RHEL8→OracleLinux8については「Switching from Red Hat Network (RHN) to Oracle Unbreakable Linux Network (ULN)」にて書かれている。

CentOS6と7に関しては「Switch your CentOS systems to Oracle Linux」に書かれている。

上記2つの内容をみつついろいろ試してみた経緯は「CentOS8をOracleLinux8に変えようとして失敗した」を見てもらうとして、試行6回目にしてようやく成功した手順を下記に記します。

(1) CentOS8を用意

CentOS8の最新版を最小インストールで用意した。

[root@centos8 ~]# uname -a
Linux centos8 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@centos8 ~]# rpm -qa|grep release
centos-linux-release-8.3-1.2011.el8.noarch
[root@centos8 ~]#

現状の /etc/yum.repos.d/ の中身は下記の状態。

[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 48
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月 10 09:32 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月 10 09:32 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月 10 09:32 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月 10 09:32 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月 10 09:32 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月 10 09:32 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月 10 09:32 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月 10 09:32 CentOS-Linux-Sources.repo
[root@centos8 ~]#

(2) gpgファイルの登録

Oracleサイト上のGPGキーをダウンロードする。

[root@centos8 ~]# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3169  100  3169    0     0   3015      0  0:00:01  0:00:01 --:--:--  3015
[root@centos8 ~]# ls -l /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
-rw-r--r--. 1 root root 3169 12月 11 09:42 /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[root@centos8 ~]#

そして、gpgを登録

[root@centos8 ~]# gpg --import /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpg: ディレクトリ'/root/.gnupg'が作成されました
gpg: keybox'/root/.gnupg/pubring.kbx'が作成されました
gpg: /root/.gnupg/trustdb.gpg: 信用データベースができました
gpg: 鍵82562EA9AD986DA3: 公開鍵"Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"をインポートしました
gpg:           処理数の合計: 1
gpg:             インポート: 1
[root@centos8 ~]#

(3) 仮のOracle Linuxレポジトリファイルを作成

Oracle Linux public YumOracle Linux 8 RepositoriesのBaseOS Latestを一時的なレポジトリファイルとして登録する。

[root@centos8 ~]# vi /etc/yum.repos.d/ol8-temp.repo
[root@centos8 ~]# cat /etc/yum.repos.d/ol8-temp.repo
[ol8_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[root@centos8 ~]# ls -l /etc/yum.repos.d/ol8-temp.repo
-rw-r--r--. 1 root root 210 12月 11 09:41 /etc/yum.repos.d/ol8-temp.repo
[root@centos8 ~]#

きちんと登録されているかを「dnf repolist」を実行して確認

[root@centos8 ~]# dnf repolist
repo id                       repo の名前
appstream                     CentOS Linux 8 - AppStream
baseos                        CentOS Linux 8 - BaseOS
extras                        CentOS Linux 8 - Extras
ol8_latest                    Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]#

(4) Oracle Linuxのリリースパッケージをインストールする

dnfコマンドだと競合を無視してインストールがうまく実行できなかったので、ここではrpmコマンドを使ってインストールする。

まずは、BaseOS Latestのパッケージ一覧ページからoraclelinux-release-8.3-1.0.4.el8.x86_64.rpm とredhat-release-8.3-1.0.0.1.el8.x86_64.rpmをダウンロードしてくる

[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73212  100 73212    0     0  1211k      0 --:--:-- --:--:-- --:--:-- 1232k
[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17540  100 17540    0     0   356k      0 --:--:-- --:--:-- --:--:--  356k
[root@centos8 ~]# ls -l *release*
-rw-r--r--. 1 root root 73212 12月 11 10:00 oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
-rw-r--r--. 1 root root 17540 12月 11 10:00 redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
[root@centos8 ~]#

強制インストールを行う

[root@centos8 ~]# rpm -Uvh --force oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:redhat-release-2:8.3-1.0.0.1.el8 ################################# [ 50%]
   2:oraclelinux-release-8:8.3-1.0.4.e################################# [100%]
[root@centos8 ~]#

この段階だとcentos-linux-releaseが残ってしまっているので、削除する。

[root@centos8 ~]# rpm -qa|grep release
oraclelinux-release-8.3-1.0.4.el8.x86_64
centos-linux-release-8.3-1.2011.el8.noarch
redhat-release-8.3-1.0.0.1.el8.x86_64
[root@centos8 ~]# rpm -ev centos-linux-release
パッケージの準備中...
centos-linux-release-8.3-1.2011.el8.noarch
[root@centos8 ~]# rpm -qa|grep release
oraclelinux-release-8.3-1.0.4.el8.x86_64
redhat-release-8.3-1.0.0.1.el8.x86_64
[root@centos8 ~]#

(5) CentOSレポジトリファイルパッケージの削除

現状登録されているCentOSのレポジトリパッケージを削除する。

[root@centos8 ~]# dnf list --installed *centos*
インストール済みパッケージ
centos-gpg-keys.noarch                     1:8-2.el8                   @anaconda
centos-linux-repos.noarch                  8-2.el8                     @anaconda
[root@centos8 ~]# dnf remove centos-linux-repos
依存関係が解決しました。
================================================================================
 パッケージ               Arch         バージョン         リポジトリー    サイズ
================================================================================
削除中:
 centos-linux-repos       noarch       8-2.el8            @anaconda        26 k
未使用の依存関係の削除:
 centos-gpg-keys          noarch       1:8-2.el8          @anaconda       3.3 k

トランザクションの概要
================================================================================
削除  2 パッケージ

解放された容量: 30 k
これでよろしいですか? [y/N]: y
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  削除             : centos-linux-repos-8-2.el8.noarch                      1/2
  削除             : centos-gpg-keys-1:8-2.el8.noarch                       2/2
  検証             : centos-gpg-keys-1:8-2.el8.noarch                       1/2
  検証             : centos-linux-repos-8-2.el8.noarch                      2/2

削除しました:
  centos-gpg-keys-1:8-2.el8.noarch       centos-linux-repos-8-2.el8.noarch

完了しました!
[root@centos8 ~]# dnf list --installed *centos*
エラー: 表示するための一致したパッケージはありません
[root@centos8 ~]#

これにより、/etc/yum.repos.d/ にあったCentOS関連のレポジトリファイルが削除された。

[root@centos8 ~]# dnf repolist
repo id                       repo の名前
ol8_latest                    Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 4
-rw-r--r--. 1 root root 210 12月 11 09:41 ol8-temp.repo
[root@centos8 ~]#

(6) Oralce Linuxのレポジトリパッケージの追加

Oracle Linuxのレポジトリパッケージは oraclelinux-release-el8 なので、インストールを行う。

[root@centos8 ~]# dnf install oraclelinux-release-el8
メタデータの期限切れの最終確認: 0:19:39 時間前の 2020年12月11日 09時47分10秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ                   Arch        バージョン      リポジトリー    サイズ
================================================================================
インストール:
 oraclelinux-release-el8      x86_64      1.0-14.el8      ol8_latest       18 k

トランザクションの概要
================================================================================
インストール  1 パッケージ

合計サイズ: 18 k
インストール済みのサイズ: 20 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
[SKIPPED] oraclelinux-release-el8-1.0-14.el8.x86_64.rpm: Already downloaded
--------------------------------------------------------------------------------
合計                                            1.7 MB/s |  18 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール     : oraclelinux-release-el8-1.0-14.el8.x86_64              1/1
  scriptletの実行中: oraclelinux-release-el8-1.0-14.el8.x86_64              1/1
  検証             : oraclelinux-release-el8-1.0-14.el8.x86_64              1/1

インストール済み:
  oraclelinux-release-el8-1.0-14.el8.x86_64

完了しました!
[root@centos8 ~]# dnf repolist
repo id           repo の名前
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
ol8_latest        Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 12
-rw-r--r--. 1 root root  210 12月 11 09:41 ol8-temp.repo
-rw-r--r--. 1 root root 1786 11月  4 14:43 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  470 11月  6 11:14 uek-ol8.repo
[root@centos8 ~]#

インストールにより 仮レポジトリファイルの /etc/yum.repos.d/ol8-temp.repo は不要になったため、削除する。

[root@centos8 ~]# rm /etc/yum.repos.d/ol8-temp.repo
rm: 通常ファイル '/etc/yum.repos.d/ol8-temp.repo' を削除しますか? y
[root@centos8 ~]# dnf repolist
repo id           repo の名前
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 8
-rw-r--r--. 1 root root 1786 11月  4 14:43 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  470 11月  6 11:14 uek-ol8.repo
[root@centos8 ~]#

(7) grub/EFI周りのファイル更新

grub2関連パッケージのディレクトリ構造がCentOSとOracle Linuxでは異なっているため、そこらへんを調整する必要がある。

まず、現状を確認

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31  9月  9 04:00 /etc/grub2-efi.cfg -> ../boot/efi/EFI/centos/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1572
-rwx------. 1 root root 1244496  8月  1 10:55 BOOTX64.EFI
-rwx------. 1 root root  362264  8月  1 10:55 fbx64.efi

/boot/efi/EFI/centos:
合計 5436
-rwx------. 1 root root     134  8月  1 10:55 BOOTX64.CSV
drwx------. 2 root root    4096  9月  9 04:00 fonts
-rwx------. 1 root root    6544 12月 11 09:30 grub.cfg
-rwx------. 1 root root    1024 12月 11 09:34 grubenv
-rwx------. 1 root root 1893144  9月  9 04:00 grubx64.efi
-rwx------. 1 root root 1162400  8月  1 10:55 mmx64.efi
-rwx------. 1 root root 1238416  8月  1 10:55 shimx64-centos.efi
-rwx------. 1 root root 1244496  8月  1 10:55 shimx64.efi
[root@centos8 ~]#

単純に「dnf update」しただけだと、ここらへんのディレクトリ構成がめちゃくちゃになるので、ちゃんと手当が必要となる。

ブートに関わるファイルは grub2-efi-x64とshim-x64に含まれている。(詳細は「CentOS8をOracleLinux8に変えようとして失敗した」の試行6を参照)

現状インストールされているパッケージと、アップデート対象となっているかを確認する。

[root@centos8 ~]# dnf list --installed grub2*
インストール済みパッケージ
grub2-common.noarch                       1:2.02-90.el8                @anaconda
grub2-efi-x64.x86_64                      1:2.02-90.el8                @anaconda
grub2-tools.x86_64                        1:2.02-90.el8                @anaconda
grub2-tools-extra.x86_64                  1:2.02-90.el8                @anaconda
grub2-tools-minimal.x86_64                1:2.02-90.el8                @anaconda
[root@centos8 ~]# dnf list --upgrade grub2*
Oracle Linux 8 BaseOS Latest (x86_64)           5.0 MB/s |  27 MB     00:05
Oracle Linux 8 Application Stream (x86_64)      6.2 MB/s |  21 MB     00:03
Latest Unbreakable Enterprise Kernel Release 6  4.1 MB/s |  11 MB     00:02
メタデータの期限切れの最終確認: 0:00:04 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
利用可能なアップグレード
grub2-common.noarch                 1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-efi-x64.x86_64                1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools.x86_64                  1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools-extra.x86_64            1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools-minimal.x86_64          1:2.02-90.0.1.el8          ol8_baseos_latest
[root@centos8 ~]# dnf list --installed shim*
インストール済みパッケージ
shim-x64.x86_64                      15-15.el8_2                       @anaconda
[root@centos8 ~]# dnf list --upgrade shim*
メタデータの期限切れの最終確認: 0:01:03 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
エラー: 表示するための一致したパッケージはありません
[root@centos8 ~]#

上記の場合、shim-x64は新しいバージョンがないため、Oralce Linuxが提供するパッケージに置き換わらないということになる。

では、shim-x64のOracle Linuxバージョンは何か確認する。

[root@centos8 ~]# dnf list shim*
メタデータの期限切れの最終確認: 0:05:07 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
インストール済みパッケージ
shim-x64.x86_64                   15-15.el8_2                  @anaconda
利用可能なパッケージ
shim.src                          15-11.0.5                    ol8_baseos_latest
shim-ia32.x86_64                  15-11.0.5                    ol8_baseos_latest
[root@centos8 ~]#

バージョンが古く 15-11.0.5である模様。このため、shim-x64については「dnf downgrade」を行う必要がある。

まずはgrub2関連をアップデート

[root@centos8 ~]# dnf update grub2*
メタデータの期限切れの最終確認: 0:06:25 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ            Arch     バージョン            リポジトリー        サイズ
================================================================================
アップグレード:
 grub2-common          noarch   1:2.02-90.0.1.el8     ol8_baseos_latest   885 k
 grub2-efi-x64         x86_64   1:2.02-90.0.1.el8     ol8_baseos_latest   409 k
 grub2-tools           x86_64   1:2.02-90.0.1.el8     ol8_baseos_latest   2.0 M
 grub2-tools-extra     x86_64   1:2.02-90.0.1.el8     ol8_baseos_latest   1.1 M
 grub2-tools-minimal   x86_64   1:2.02-90.0.1.el8     ol8_baseos_latest   205 k
依存関係のインストール:
 grub2-tools-efi       x86_64   1:2.02-90.0.1.el8     ol8_baseos_latest   470 k

トランザクションの概要
================================================================================
インストール    1 パッケージ
アップグレード  5 パッケージ

ダウンロードサイズの合計: 4.9 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/6): grub2-tools-efi-2.02-90.0.1.el8.x86_64.r 1.6 MB/s | 470 kB     00:00
<略>
  検証             : grub2-tools-minimal-1:2.02-90.el8.x86_64             11/11

アップグレード済み:
  grub2-common-1:2.02-90.0.1.el8.noarch
  grub2-efi-x64-1:2.02-90.0.1.el8.x86_64
  grub2-tools-1:2.02-90.0.1.el8.x86_64
  grub2-tools-extra-1:2.02-90.0.1.el8.x86_64
  grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64

インストール済み:
  grub2-tools-efi-1:2.02-90.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

続いてshim-x64をダウングレード

[root@centos8 ~]# dnf downgrade shim-x64
メタデータの期限切れの最終確認: 0:07:27 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ       Arch     バージョン                 リポジトリー        サイズ
================================================================================
インストール:
 kernel           x86_64   4.18.0-193.28.1.el8_2      ol8_baseos_latest   2.8 M
 kernel-core      x86_64   4.18.0-193.28.1.el8_2      ol8_baseos_latest    28 M
 kernel-modules   x86_64   4.18.0-193.28.1.el8_2      ol8_baseos_latest    24 M
ダウングレード:
 shim-x64         x86_64   15-11.0.5                  ol8_baseos_latest   656 k

トランザクションの概要
================================================================================
インストール    3 パッケージ
ダウングレード  1 パッケージ

ダウンロードサイズの合計: 55 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/4): kernel-4.18.0-193.28.1.el8_2.x86_64.rpm  2.6 MB/s | 2.8 MB     00:01
<略>
  検証             : kernel-modules-4.18.0-193.28.1.el8_2.x86_64            5/5

ダウングレード済み:
  shim-x64-15-11.0.5.x86_64

インストール済み:
  kernel-4.18.0-193.28.1.el8_2.x86_64
  kernel-core-4.18.0-193.28.1.el8_2.x86_64
  kernel-modules-4.18.0-193.28.1.el8_2.x86_64

完了しました!
[root@centos8 ~]#

shim-x64と一緒にOralce Linuxのカーネルパッケージに置き換えも実施された。

grub関連ファイルの状況を確認する。

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx------. 1 root root 1216760  7月 25 03:42 BOOTX64.EFI
-rwx------. 1 root root  361600  7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx------. 1 root root 6544 12月 11 09:30 grub.cfg
-rwx------. 1 root root 1024 12月 11 09:34 grubenv

/boot/efi/EFI/redhat:
合計 4196
-rwx------. 1 root root     134  7月 25 03:42 BOOTX64.CSV
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    1024 12月 11 10:19 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
-rwx------. 1 root root 1165032  7月 25 03:42 mmx64.efi
-rwx------. 1 root root 1216760  7月 25 03:42 shimx64.efi
[root@centos8 ~]#

/etc/grub2-efi.cfg のリンク先が作成されていないことを確認。

/boot/efi/EFI/redhat/grub.cfg を作成するために、grub2-mkconfigコマンドを実行

[root@centos8 ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for EFI firmware configuration
done
[root@centos8 ~]#

ファイルが作成されたかを確認

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx------. 1 root root 1216760  7月 25 03:42 BOOTX64.EFI
-rwx------. 1 root root  361600  7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx------. 1 root root 6544 12月 11 09:30 grub.cfg
-rwx------. 1 root root 1024 12月 11 09:34 grubenv

/boot/efi/EFI/redhat:
合計 4204
-rwx------. 1 root root     134  7月 25 03:42 BOOTX64.CSV
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    6544 12月 11 10:26 grub.cfg
-rwx------. 1 root root    1024 12月 11 10:26 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
-rwx------. 1 root root 1165032  7月 25 03:42 mmx64.efi
-rwx------. 1 root root 1216760  7月 25 03:42 shimx64.efi
[root@centos8 ~]#

作成されていることを確認。

(8) 残りのアップデートを実行

他に残っているアップデートを「dnf update」で適用する。

[root@centos8 ~]# dnf update
メタデータの期限切れの最終確認: 0:15:44 時間前の 2020年12月11日 10時11分39秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ           Arch   バージョン                 リポジトリー      サイズ
================================================================================
アップグレード:
 NetworkManager       x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 2.4 M
 NetworkManager-libnm x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 1.8 M
 NetworkManager-team  x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 142 k
 NetworkManager-tui   x86_64 1:1.26.0-9.0.2.el8_3       ol8_baseos_latest 320 k
 chrony               x86_64 3.5-1.0.1.el8              ol8_baseos_latest 271 k
 coreutils            x86_64 8.30-8.0.1.el8             ol8_baseos_latest 1.2 M
 coreutils-common     x86_64 8.30-8.0.1.el8             ol8_baseos_latest 2.0 M
 dbus                 x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest  41 k
 dbus-common          noarch 1:1.12.8-11.0.1.el8        ol8_baseos_latest  45 k
 dbus-daemon          x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest 240 k
 dbus-libs            x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest 183 k
 dbus-tools           x86_64 1:1.12.8-11.0.1.el8        ol8_baseos_latest  85 k
 dbxtool              x86_64 8-5.0.1.el8                ol8_baseos_latest  41 k
 dracut               x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest 369 k
 dracut-config-rescue x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest  57 k
 dracut-network       x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest 105 k
 dracut-squash        x86_64 049-95.git20200804.0.2.el8 ol8_baseos_latest  58 k
 efi-filesystem       noarch 3-2.0.2.el8                ol8_baseos_latest 9.0 k
 efibootmgr           x86_64 16-1.0.1.el8               ol8_baseos_latest  47 k
 firewalld            noarch 0.8.2-2.0.1.el8            ol8_baseos_latest 487 k
 firewalld-filesystem noarch 0.8.2-2.0.1.el8            ol8_baseos_latest  76 k
 fuse                 x86_64 2.9.7-12.0.2.el8           ol8_baseos_latest  84 k
 fuse-common          x86_64 3.2.1-12.0.2.el8           ol8_baseos_latest  22 k
 fuse-libs            x86_64 2.9.7-12.0.2.el8           ol8_baseos_latest 104 k
 glibc                x86_64 2.28-127.0.1.el8           ol8_baseos_latest 3.6 M
 glibc-common         x86_64 2.28-127.0.1.el8           ol8_baseos_latest 1.3 M
 glibc-langpack-ja    x86_64 2.28-127.0.1.el8           ol8_baseos_latest 330 k
 grubby               x86_64 8.40-41.0.1.el8            ol8_baseos_latest  50 k
 iproute              x86_64 5.4.0-1.0.1.el8            ol8_UEKR6         665 k
 iptables             x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest 583 k
 iptables-ebtables    x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest  71 k
 iptables-libs        x86_64 1.8.4-15.0.1.el8           ol8_baseos_latest 106 k
 iwl100-firmware      noarch 999:39.31.5.1-999.5.el8    ol8_baseos_latest 151 k
 iwl1000-firmware     noarch 999:39.31.5.1-999.5.el8    ol8_baseos_latest 215 k
 iwl105-firmware      noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 236 k
 iwl135-firmware      noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 245 k
 iwl2000-firmware     noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 238 k
 iwl2030-firmware     noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 247 k
 iwl3160-firmware     noarch 999:25.30.13.0-999.5.el8   ol8_baseos_latest 1.6 M
 iwl5000-firmware     noarch 999:8.83.5.1_1-999.5.el8   ol8_baseos_latest 295 k
 iwl5150-firmware     noarch 999:8.24.2.2-999.5.el8     ol8_baseos_latest 148 k
 iwl6000-firmware     noarch 999:9.221.4.1-999.5.el8    ol8_baseos_latest 168 k
 iwl6000g2a-firmware  noarch 999:18.168.6.1-999.5.el8   ol8_baseos_latest 311 k
 iwl6050-firmware     noarch 999:41.28.5.1-999.5.el8    ol8_baseos_latest 244 k
 iwl7260-firmware     noarch 999:25.30.13.0-999.5.el8   ol8_baseos_latest  15 M
 kexec-tools          x86_64 2.0.20-34.0.2.el8          ol8_baseos_latest 498 k
 kmod                 x86_64 25-16.0.1.el8              ol8_baseos_latest 128 k
 kmod-libs            x86_64 25-16.0.1.el8              ol8_baseos_latest  70 k
 libdnf               x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 650 k
 libgcc               x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest  85 k
 libgomp              x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest 211 k
 libkcapi             x86_64 1.2.0-2.0.1.el8            ol8_baseos_latest  48 k
 libkcapi-hmaccalc    x86_64 1.2.0-2.0.1.el8            ol8_baseos_latest  31 k
 libreport-filesystem x86_64 2.9.5-15.0.1.el8           ol8_baseos_latest  22 k
 libsss_autofs        x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 108 k
 libsss_certmap       x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 141 k
 libsss_idmap         x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 111 k
 libsss_nss_idmap     x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 118 k
 libsss_sudo          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 107 k
 libstdc++            x86_64 8.3.1-5.1.0.1.el8          ol8_baseos_latest 458 k
 libxml2              x86_64 2.9.7-8.0.1.el8            ol8_baseos_latest 696 k
 libxslt              x86_64 1.1.32-5.0.1.el8           ol8_baseos_latest 250 k
 libzstd              x86_64 1.4.4-1.0.1.el8            ol8_baseos_latest 266 k
 linux-firmware       noarch 999:20200902-999.5.gitd5f9eea5.el8
                                                        ol8_baseos_latest 122 M
 microcode_ctl        x86_64 4:20200609-2.20201027.1.0.1.el8_3
                                                        ol8_baseos_latest 4.5 M
 mozjs60              x86_64 60.9.0-4.0.1.el8           ol8_baseos_latest 6.6 M
 open-vm-tools        x86_64 11.1.0-2.0.1.el8           ol8_appstream     716 k
 os-prober            x86_64 1.74-6.0.1.el8             ol8_baseos_latest  51 k
 parted               x86_64 3.2-38.0.1.el8             ol8_baseos_latest 556 k
 platform-python      x86_64 3.6.8-31.0.1.el8           ol8_baseos_latest  83 k
 plymouth             x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream     127 k
 plymouth-core-libs   x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream     122 k
 plymouth-scripts     x86_64 0.9.4-7.20200615git1e36e30.0.1.el8
                                                        ol8_appstream      44 k
 policycoreutils      x86_64 2.9-9.0.1.el8              ol8_baseos_latest 377 k
 polkit               x86_64 0.115-11.0.1.el8           ol8_baseos_latest 154 k
 polkit-libs          x86_64 0.115-11.0.1.el8           ol8_baseos_latest  76 k
 python3-firewall     noarch 0.8.2-2.0.1.el8            ol8_baseos_latest 392 k
 python3-hawkey       x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 112 k
 python3-libdnf       x86_64 0.48.0-5.0.2.el8           ol8_baseos_latest 757 k
 python3-libs         x86_64 3.6.8-31.0.1.el8           ol8_baseos_latest 7.8 M
 python3-libxml2      x86_64 2.9.7-8.0.1.el8            ol8_baseos_latest 237 k
 selinux-policy       noarch 3.14.3-54.0.1.el8          ol8_baseos_latest 623 k
 selinux-policy-targeted
                      noarch 3.14.3-54.0.1.el8          ol8_baseos_latest  15 M
 sssd-client          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 171 k
 sssd-common          x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 1.5 M
 sssd-kcm             x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 224 k
 sssd-nfs-idmap       x86_64 2.3.0-9.0.1.el8            ol8_baseos_latest 105 k
 systemd              x86_64 239-41.0.1.el8_3           ol8_baseos_latest 3.6 M
 systemd-libs         x86_64 239-41.0.1.el8_3           ol8_baseos_latest 1.1 M
 systemd-pam          x86_64 239-41.0.1.el8_3           ol8_baseos_latest 457 k
 systemd-udev         x86_64 239-41.0.1.el8_3           ol8_baseos_latest 1.3 M
 tuned                noarch 2.14.0-3.0.1.el8           ol8_baseos_latest 294 k
 vim-minimal          x86_64 2:8.0.1763-15.0.1.el8      ol8_baseos_latest 572 k
 xfsprogs             x86_64 5.4.0-1.0.1.el8            ol8_UEKR6         1.1 M

トランザクションの概要
================================================================================
アップグレード  94 パッケージ

ダウンロードサイズの合計: 210 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/94): efi-filesystem-3-2.0.2.el8.noarch.rpm    59 kB/s | 9.0 kB     00:00
<略>
  検証             : xfsprogs-5.0.0-4.el8.x86_64                        188/188

アップグレード済み:
  NetworkManager-1:1.26.0-9.0.2.el8_3.x86_64
  NetworkManager-libnm-1:1.26.0-9.0.2.el8_3.x86_64
  NetworkManager-team-1:1.26.0-9.0.2.el8_3.x86_64
  NetworkManager-tui-1:1.26.0-9.0.2.el8_3.x86_64
  chrony-3.5-1.0.1.el8.x86_64
  coreutils-8.30-8.0.1.el8.x86_64
  coreutils-common-8.30-8.0.1.el8.x86_64
  dbus-1:1.12.8-11.0.1.el8.x86_64
  dbus-common-1:1.12.8-11.0.1.el8.noarch
  dbus-daemon-1:1.12.8-11.0.1.el8.x86_64
  dbus-libs-1:1.12.8-11.0.1.el8.x86_64
  dbus-tools-1:1.12.8-11.0.1.el8.x86_64
  dbxtool-8-5.0.1.el8.x86_64
  dracut-049-95.git20200804.0.2.el8.x86_64
  dracut-config-rescue-049-95.git20200804.0.2.el8.x86_64
  dracut-network-049-95.git20200804.0.2.el8.x86_64
  dracut-squash-049-95.git20200804.0.2.el8.x86_64
  efi-filesystem-3-2.0.2.el8.noarch
  efibootmgr-16-1.0.1.el8.x86_64
  firewalld-0.8.2-2.0.1.el8.noarch
  firewalld-filesystem-0.8.2-2.0.1.el8.noarch
  fuse-2.9.7-12.0.2.el8.x86_64
  fuse-common-3.2.1-12.0.2.el8.x86_64
  fuse-libs-2.9.7-12.0.2.el8.x86_64
  glibc-2.28-127.0.1.el8.x86_64
  glibc-common-2.28-127.0.1.el8.x86_64
  glibc-langpack-ja-2.28-127.0.1.el8.x86_64
  grubby-8.40-41.0.1.el8.x86_64
  iproute-5.4.0-1.0.1.el8.x86_64
  iptables-1.8.4-15.0.1.el8.x86_64
  iptables-ebtables-1.8.4-15.0.1.el8.x86_64
  iptables-libs-1.8.4-15.0.1.el8.x86_64
  iwl100-firmware-999:39.31.5.1-999.5.el8.noarch
  iwl1000-firmware-999:39.31.5.1-999.5.el8.noarch
  iwl105-firmware-999:18.168.6.1-999.5.el8.noarch
  iwl135-firmware-999:18.168.6.1-999.5.el8.noarch
  iwl2000-firmware-999:18.168.6.1-999.5.el8.noarch
  iwl2030-firmware-999:18.168.6.1-999.5.el8.noarch
  iwl3160-firmware-999:25.30.13.0-999.5.el8.noarch
  iwl5000-firmware-999:8.83.5.1_1-999.5.el8.noarch
  iwl5150-firmware-999:8.24.2.2-999.5.el8.noarch
  iwl6000-firmware-999:9.221.4.1-999.5.el8.noarch
  iwl6000g2a-firmware-999:18.168.6.1-999.5.el8.noarch
  iwl6050-firmware-999:41.28.5.1-999.5.el8.noarch
  iwl7260-firmware-999:25.30.13.0-999.5.el8.noarch
  kexec-tools-2.0.20-34.0.2.el8.x86_64
  kmod-25-16.0.1.el8.x86_64
  kmod-libs-25-16.0.1.el8.x86_64
  libdnf-0.48.0-5.0.2.el8.x86_64
  libgcc-8.3.1-5.1.0.1.el8.x86_64
  libgomp-8.3.1-5.1.0.1.el8.x86_64
  libkcapi-1.2.0-2.0.1.el8.x86_64
  libkcapi-hmaccalc-1.2.0-2.0.1.el8.x86_64
  libreport-filesystem-2.9.5-15.0.1.el8.x86_64
  libsss_autofs-2.3.0-9.0.1.el8.x86_64
  libsss_certmap-2.3.0-9.0.1.el8.x86_64
  libsss_idmap-2.3.0-9.0.1.el8.x86_64
  libsss_nss_idmap-2.3.0-9.0.1.el8.x86_64
  libsss_sudo-2.3.0-9.0.1.el8.x86_64
  libstdc++-8.3.1-5.1.0.1.el8.x86_64
  libxml2-2.9.7-8.0.1.el8.x86_64
  libxslt-1.1.32-5.0.1.el8.x86_64
  libzstd-1.4.4-1.0.1.el8.x86_64
  linux-firmware-999:20200902-999.5.gitd5f9eea5.el8.noarch
  microcode_ctl-4:20200609-2.20201027.1.0.1.el8_3.x86_64
  mozjs60-60.9.0-4.0.1.el8.x86_64
  open-vm-tools-11.1.0-2.0.1.el8.x86_64
  os-prober-1.74-6.0.1.el8.x86_64
  parted-3.2-38.0.1.el8.x86_64
  platform-python-3.6.8-31.0.1.el8.x86_64
  plymouth-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  plymouth-scripts-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  policycoreutils-2.9-9.0.1.el8.x86_64
  polkit-0.115-11.0.1.el8.x86_64
  polkit-libs-0.115-11.0.1.el8.x86_64
  python3-firewall-0.8.2-2.0.1.el8.noarch
  python3-hawkey-0.48.0-5.0.2.el8.x86_64
  python3-libdnf-0.48.0-5.0.2.el8.x86_64
  python3-libs-3.6.8-31.0.1.el8.x86_64
  python3-libxml2-2.9.7-8.0.1.el8.x86_64
  selinux-policy-3.14.3-54.0.1.el8.noarch
  selinux-policy-targeted-3.14.3-54.0.1.el8.noarch
  sssd-client-2.3.0-9.0.1.el8.x86_64
  sssd-common-2.3.0-9.0.1.el8.x86_64
  sssd-kcm-2.3.0-9.0.1.el8.x86_64
  sssd-nfs-idmap-2.3.0-9.0.1.el8.x86_64
  systemd-239-41.0.1.el8_3.x86_64
  systemd-libs-239-41.0.1.el8_3.x86_64
  systemd-pam-239-41.0.1.el8_3.x86_64
  systemd-udev-239-41.0.1.el8_3.x86_64
  tuned-2.14.0-3.0.1.el8.noarch
  vim-minimal-2:8.0.1763-15.0.1.el8.x86_64
  xfsprogs-5.4.0-1.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

(9) 再起動

再起動すると、Oracle Linux Serverとして起動してくる。

以上

CentOS8をOracleLinux8に変えようとして失敗した


CentOS8がRHEL8の組み替え版であることをやめ、RHEL8の先行開発版であるCentOS Stream版のみになる、という発表が騒がしている。(CentOS Project shifts focus to CentOS Stream)

いまのところはOracle Linuxがどうなるかは発表ないけど、たぶん、商売的には相変わらずpublic yumも公開し続けてくれるんじゃないかなーと思うので、CentOS8からOracleLinux8に移行できるか確認。

過去に「RHEL4/CentOS4をOracle Linux4に!」「RHEL6/CentOS6をOracle Linuxにしてみる」とやってるし余裕でしょ!!!

……

と失敗した記録がこちらでございます。

成功例については「CentOS8からOracle Linux 8への移行(成功例/非公式手順/EFI環境用」を見てください。

2021/09/22追記:「grubで止まったEFI機のLinuxを起動させる」でOracle Cloud上でCentOS7→OracleLinux7への移行に失敗したものを起動させる手順の説明もしています。

移行手法の検討

公式系ドキュメントとしては、RHEL→OracleLinuxについての「Switching from Red Hat Network (RHN) to Oracle Unbreakable Linux Network (ULN)」、CentOS→OracleLinuxについての「Switch your CentOS systems to Oracle Linux」がある。

また、Oracle Linux Public Yumサーバの説明の中に「Red Hat Enterprise Linux, CentOS & Scientific Linuxからの移行」という項目もあるが、こちらはRHEL7/CentOS7用の記述になっている。

Switch your CentOS systems to Oracle Linux」の手順はインターネットに接続出来る状態で「移行用シェルスクリプトをダウンロードしてきて実行するだけ!」という簡単なもの。内部では/etc/yum.repos.d/に仮のレポジトリ設定を入れて必要なパッケージを追加したあと、CentOS専用パッケージをOracleLinuxパッケージに変更していく、という感じになっている。

で・・・ここで重大な問題点が発覚。

case "$rhel_version" in
    7*)
        repo_file=public-yum-ol7.repo
        new_releases=(oraclelinux-release oraclelinux-release-el7 redhat-release-server)
        base_packages=("${base_packages[@]}" plymouth grub2 grubby kernel-uek)
        ;;
    6*)
        repo_file=public-yum-ol6.repo
        new_releases=(oraclelinux-release oraclelinux-release-el6 redhat-release-server)
        base_packages=("${base_packages[@]}" oraclelinux-release-notes plymouth grub grubby kernel-uek)
        ;;
    *) exit_message "You appear to be running an unsupported distribution." ;;
esac

条件分けにRHEL8/CentOS8に対応する項目がない。

また、実際に実行してみるとこのスクリプトはpython2を要求しているので、最小インストールのCentOS8では動かない状態です。

というわけで、2020/12/10時点では、ドキュメント記載がない手法でアップデートを実施、ということになる。

Oracle Linux 7では https://yum.oracle.com/public-yum-ol7.repo 、Oracle Linux 6では https://yum.oracle.com/public-yum-ol6.repo だから、https://yum.oracle.com/public-yum-ol8.repo なのかな?と試してみたが、ファイルは存在せず。

Red Hat Enterprise Linux, CentOS & Scientific Linuxからの移行」の方にあるbaseurlを「Browse the Oracle Linux 8 package repositories」を参考に書き換えてみるといけそう・・・

実践(ただし失敗例)

さて、CentOS8環境を用意。2020/12/10時点の最新版になっています。

現状の/etc/yum.repos.d/ の内容は下記の様な感じ

ここに仮のOracle Linuxレポジトリファイルを作成する。

[root@centos8 ~]# vi /etc/yum.repos.d/ol8-temp.repo
[root@centos8 ~]# cat /etc/yum.repos.d/ol8-temp.repo
[ol8_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[root@centos8 ~]#

続いて、GPGファイルをダウンロードして、/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle に配置します。

[root@centos8 ~]# curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle https://yum.oracle
.com/RPM-GPG-KEY-oracle-ol8
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3169  100  3169    0     0  59792      0 --:--:-- --:--:-- --:--:-- 59792
[root@centos8 ~]# ls -l /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
-rw-r--r--. 1 root root 3169 12月 10 16:21 /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[root@centos8 ~]#

そして、アップデート実行。

[root@centos8 ~]# dnf update
Oracle Linux 8 Latest (x86_64)                  5.3 MB/s |  27 MB     00:05
メタデータの期限切れの最終確認: 0:00:08 時間前の 2020年12月10日 16時28分52秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ           Arch   バージョン                        Repo       サイズ
================================================================================
アップグレード:
 NetworkManager       x86_64 1:1.26.0-9.0.2.el8_3              ol8_latest 2.4 M
 NetworkManager-libnm x86_64 1:1.26.0-9.0.2.el8_3              ol8_latest 1.8 M
 NetworkManager-team  x86_64 1:1.26.0-9.0.2.el8_3              ol8_latest 142 k
 NetworkManager-tui   x86_64 1:1.26.0-9.0.2.el8_3              ol8_latest 320 k
 chrony               x86_64 3.5-1.0.1.el8                     ol8_latest 271 k
 coreutils            x86_64 8.30-8.0.1.el8                    ol8_latest 1.2 M
 coreutils-common     x86_64 8.30-8.0.1.el8                    ol8_latest 2.0 M
 dbus                 x86_64 1:1.12.8-11.0.1.el8               ol8_latest  41 k
 dbus-common          noarch 1:1.12.8-11.0.1.el8               ol8_latest  45 k
 dbus-daemon          x86_64 1:1.12.8-11.0.1.el8               ol8_latest 240 k
 dbus-libs            x86_64 1:1.12.8-11.0.1.el8               ol8_latest 183 k
 dbus-tools           x86_64 1:1.12.8-11.0.1.el8               ol8_latest  85 k
 dbxtool              x86_64 8-5.0.1.el8                       ol8_latest  41 k
 dracut               x86_64 049-95.git20200804.0.2.el8        ol8_latest 369 k
 dracut-config-rescue x86_64 049-95.git20200804.0.2.el8        ol8_latest  57 k
 dracut-network       x86_64 049-95.git20200804.0.2.el8        ol8_latest 105 k
 dracut-squash        x86_64 049-95.git20200804.0.2.el8        ol8_latest  58 k
 efi-filesystem       noarch 3-2.0.2.el8                       ol8_latest 9.0 k
 efibootmgr           x86_64 16-1.0.1.el8                      ol8_latest  47 k
 firewalld            noarch 0.8.2-2.0.1.el8                   ol8_latest 487 k
 firewalld-filesystem noarch 0.8.2-2.0.1.el8                   ol8_latest  76 k
 fuse                 x86_64 2.9.7-12.0.2.el8                  ol8_latest  84 k
 fuse-common          x86_64 3.2.1-12.0.2.el8                  ol8_latest  22 k
 fuse-libs            x86_64 2.9.7-12.0.2.el8                  ol8_latest 104 k
 glibc                x86_64 2.28-127.0.1.el8                  ol8_latest 3.6 M
 glibc-common         x86_64 2.28-127.0.1.el8                  ol8_latest 1.3 M
 glibc-langpack-ja    x86_64 2.28-127.0.1.el8                  ol8_latest 330 k
 grub2-common         noarch 1:2.02-90.0.1.el8                 ol8_latest 885 k
 grub2-efi-x64        x86_64 1:2.02-90.0.1.el8                 ol8_latest 409 k
 grub2-pc             x86_64 1:2.02-90.0.1.el8                 ol8_latest  40 k
 grub2-pc-modules     noarch 1:2.02-90.0.1.el8                 ol8_latest 869 k
 grub2-tools          x86_64 1:2.02-90.0.1.el8                 ol8_latest 2.0 M
 grub2-tools-efi      x86_64 1:2.02-90.0.1.el8                 ol8_latest 470 k
 grub2-tools-extra    x86_64 1:2.02-90.0.1.el8                 ol8_latest 1.1 M
 grub2-tools-minimal  x86_64 1:2.02-90.0.1.el8                 ol8_latest 205 k
 grubby               x86_64 8.40-41.0.1.el8                   ol8_latest  50 k
 iptables             x86_64 1.8.4-15.0.1.el8                  ol8_latest 583 k
 iptables-ebtables    x86_64 1.8.4-15.0.1.el8                  ol8_latest  71 k
 iptables-libs        x86_64 1.8.4-15.0.1.el8                  ol8_latest 106 k
 iwl100-firmware      noarch 999:39.31.5.1-999.5.el8           ol8_latest 151 k
 iwl1000-firmware     noarch 999:39.31.5.1-999.5.el8           ol8_latest 215 k
 iwl105-firmware      noarch 999:18.168.6.1-999.5.el8          ol8_latest 236 k
 iwl135-firmware      noarch 999:18.168.6.1-999.5.el8          ol8_latest 245 k
 iwl2000-firmware     noarch 999:18.168.6.1-999.5.el8          ol8_latest 238 k
 iwl2030-firmware     noarch 999:18.168.6.1-999.5.el8          ol8_latest 247 k
 iwl3160-firmware     noarch 999:25.30.13.0-999.5.el8          ol8_latest 1.6 M
 iwl3945-firmware     noarch 999:15.32.2.9-999.5.el8           ol8_latest  89 k
 iwl4965-firmware     noarch 999:228.61.2.24-999.5.el8         ol8_latest 103 k
 iwl5000-firmware     noarch 999:8.83.5.1_1-999.5.el8          ol8_latest 295 k
 iwl5150-firmware     noarch 999:8.24.2.2-999.5.el8            ol8_latest 148 k
 iwl6000-firmware     noarch 999:9.221.4.1-999.5.el8           ol8_latest 168 k
 iwl6000g2a-firmware  noarch 999:18.168.6.1-999.5.el8          ol8_latest 311 k
 iwl6050-firmware     noarch 999:41.28.5.1-999.5.el8           ol8_latest 244 k
 iwl7260-firmware     noarch 999:25.30.13.0-999.5.el8          ol8_latest  15 M
 kexec-tools          x86_64 2.0.20-34.0.2.el8                 ol8_latest 498 k
 kmod                 x86_64 25-16.0.1.el8                     ol8_latest 128 k
 kmod-libs            x86_64 25-16.0.1.el8                     ol8_latest  70 k
 libdnf               x86_64 0.48.0-5.0.2.el8                  ol8_latest 650 k
 libgcc               x86_64 8.3.1-5.1.0.1.el8                 ol8_latest  85 k
 libgomp              x86_64 8.3.1-5.1.0.1.el8                 ol8_latest 211 k
 libkcapi             x86_64 1.2.0-2.0.1.el8                   ol8_latest  48 k
 libkcapi-hmaccalc    x86_64 1.2.0-2.0.1.el8                   ol8_latest  31 k
 libreport-filesystem x86_64 2.9.5-15.0.1.el8                  ol8_latest  22 k
 libsss_autofs        x86_64 2.3.0-9.0.1.el8                   ol8_latest 108 k
 libsss_certmap       x86_64 2.3.0-9.0.1.el8                   ol8_latest 141 k
 libsss_idmap         x86_64 2.3.0-9.0.1.el8                   ol8_latest 111 k
 libsss_nss_idmap     x86_64 2.3.0-9.0.1.el8                   ol8_latest 118 k
 libsss_sudo          x86_64 2.3.0-9.0.1.el8                   ol8_latest 107 k
 libstdc++            x86_64 8.3.1-5.1.0.1.el8                 ol8_latest 458 k
 libxml2              x86_64 2.9.7-8.0.1.el8                   ol8_latest 696 k
 libxslt              x86_64 1.1.32-5.0.1.el8                  ol8_latest 250 k
 libzstd              x86_64 1.4.4-1.0.1.el8                   ol8_latest 266 k
 linux-firmware       noarch 999:20200902-999.5.gitd5f9eea5.el8
                                                               ol8_latest 122 M
 microcode_ctl        x86_64 4:20200609-2.20201027.1.0.1.el8_3 ol8_latest 4.5 M
 mozjs60              x86_64 60.9.0-4.0.1.el8                  ol8_latest 6.6 M
 os-prober            x86_64 1.74-6.0.1.el8                    ol8_latest  51 k
 parted               x86_64 3.2-38.0.1.el8                    ol8_latest 556 k
 platform-python      x86_64 3.6.8-31.0.1.el8                  ol8_latest  83 k
 policycoreutils      x86_64 2.9-9.0.1.el8                     ol8_latest 377 k
 polkit               x86_64 0.115-11.0.1.el8                  ol8_latest 154 k
 polkit-libs          x86_64 0.115-11.0.1.el8                  ol8_latest  76 k
 python3-firewall     noarch 0.8.2-2.0.1.el8                   ol8_latest 392 k
 python3-hawkey       x86_64 0.48.0-5.0.2.el8                  ol8_latest 112 k
 python3-libdnf       x86_64 0.48.0-5.0.2.el8                  ol8_latest 757 k
 python3-libs         x86_64 3.6.8-31.0.1.el8                  ol8_latest 7.8 M
 python3-libxml2      x86_64 2.9.7-8.0.1.el8                   ol8_latest 237 k
 selinux-policy       noarch 3.14.3-54.0.1.el8                 ol8_latest 623 k
 selinux-policy-targeted
                      noarch 3.14.3-54.0.1.el8                 ol8_latest  15 M
 sssd-client          x86_64 2.3.0-9.0.1.el8                   ol8_latest 171 k
 sssd-common          x86_64 2.3.0-9.0.1.el8                   ol8_latest 1.5 M
 sssd-kcm             x86_64 2.3.0-9.0.1.el8                   ol8_latest 224 k
 sssd-nfs-idmap       x86_64 2.3.0-9.0.1.el8                   ol8_latest 105 k
 systemd              x86_64 239-41.0.1.el8_3                  ol8_latest 3.6 M
 systemd-libs         x86_64 239-41.0.1.el8_3                  ol8_latest 1.1 M
 systemd-pam          x86_64 239-41.0.1.el8_3                  ol8_latest 457 k
 systemd-udev         x86_64 239-41.0.1.el8_3                  ol8_latest 1.3 M
 tuned                noarch 2.14.0-3.0.1.el8                  ol8_latest 294 k
 vim-minimal          x86_64 2:8.0.1763-15.0.1.el8             ol8_latest 572 k

トランザクションの概要
================================================================================
アップグレード  98 パッケージ

ダウンロードサイズの合計: 214 M
これでよろしいですか? [y/N]: y
(1/98): efi-filesystem-3-2.0.2.el8.noarch.rpm   5.0 kB/s | 9.0 kB     00:01
<略>
(98/98): microcode_ctl-20200609-2.20201027.1.0. 264 kB/s | 4.5 MB     00:17
--------------------------------------------------------------------------------
合計                                            4.0 MB/s | 214 MB     00:53
警告: /var/cache/dnf/ol8_latest-e4c6155830ad002c/packages/chrony-3.5-1.0.1.el8.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ad986da3: NOKEY
Oracle Linux 8 Latest (x86_64)                  3.0 MB/s | 3.1 kB     00:00
GPG 鍵 0xAD986DA3 をインポート中:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  scriptletの実行中: glibc-langpack-ja-2.28-127.0.1.el8.x86_64              1/1
  アップグレード   : glibc-langpack-ja-2.28-127.0.1.el8.x86_64            1/196
<略>
  tuned-2.14.0-3.0.1.el8.noarch
  vim-minimal-2:8.0.1763-15.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

アップデート終わったあとのレポジトリの状態は?

[root@centos8 ~]# dnf repolist
repo id                       repo の名前
appstream                     CentOS Linux 8 - AppStream
baseos                        CentOS Linux 8 - BaseOS
extras                        CentOS Linux 8 - Extras
ol8_latest                    Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]# rpm -qa|grep release
centos-linux-release-8.3-1.2011.el8.noarch
[root@centos8 ~]#

うーん・・・releaseが差し替わってませんね

[root@centos8 ~]# dnf install oraclelinux-release-el8
メタデータの期限切れの最終確認: 0:07:32 時間前の 2020年12月10日 16時28分52秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ                   Arch        バージョン      リポジトリー    サイズ
================================================================================
インストール:
 oraclelinux-release-el8      x86_64      1.0-14.el8      ol8_latest       18 k

トランザクションの概要
================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 18 k
インストール済みのサイズ: 20 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
oraclelinux-release-el8-1.0-14.el8.x86_64.rpm    93 kB/s |  18 kB     00:00
--------------------------------------------------------------------------------
合計                                             91 kB/s |  18 kB     00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール     : oraclelinux-release-el8-1.0-14.el8.x86_64              1/1
  scriptletの実行中: oraclelinux-release-el8-1.0-14.el8.x86_64              1/1
  検証             : oraclelinux-release-el8-1.0-14.el8.x86_64              1/1

インストール済み:
  oraclelinux-release-el8-1.0-14.el8.x86_64

完了しました!
[root@centos8 ~]#

もう一度アップデートを実行

[root@centos8 ~]# dnf update
Oracle Linux 8 BaseOS Latest (x86_64)           5.1 MB/s |  27 MB     00:05
Oracle Linux 8 Application Stream (x86_64)      5.7 MB/s |  21 MB     00:03
Latest Unbreakable Enterprise Kernel Release 6  6.9 MB/s |  11 MB     00:01
メタデータの期限切れの最終確認: 0:00:04 時間前の 2020年12月10日 16時37分44秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ
          Arch   バージョン                                 リポジトリー  サイズ
================================================================================
アップグレード:
 dnf-plugin-spacewalk
          noarch 2.8.5-11.0.2.module+el8.3.0+7814+aac1f1cb  ol8_appstream  24 k
 iproute  x86_64 5.4.0-1.0.1.el8                            ol8_UEKR6     665 k
 open-vm-tools
          x86_64 11.1.0-2.0.1.el8                           ol8_appstream 716 k
 plymouth x86_64 0.9.4-7.20200615git1e36e30.0.1.el8         ol8_appstream 127 k
 plymouth-core-libs
          x86_64 0.9.4-7.20200615git1e36e30.0.1.el8         ol8_appstream 122 k
 plymouth-scripts
          x86_64 0.9.4-7.20200615git1e36e30.0.1.el8         ol8_appstream  44 k
 python3-dnf-plugin-spacewalk
          noarch 2.8.5-11.0.2.module+el8.3.0+7814+aac1f1cb  ol8_appstream  31 k
 python3-rhn-client-tools
          x86_64 2.8.16-13.0.3.module+el8.3.0+7814+aac1f1cb ol8_appstream 110 k
 python3-rhnlib
          noarch 2.8.6-8.0.1.module+el8.3.0+7814+aac1f1cb   ol8_appstream  77 k
 rhn-client-tools
          x86_64 2.8.16-13.0.3.module+el8.3.0+7814+aac1f1cb ol8_appstream 387 k
 xfsprogs x86_64 5.4.0-1.0.1.el8                            ol8_UEKR6     1.1 M

トランザクションの概要
================================================================================
アップグレード  11 パッケージ

ダウンロードサイズの合計: 3.3 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/11): python3-dnf-plugin-spacewalk-2.8.5-11.0  14 kB/s |  31 kB     00:02
<略>
  検証             : xfsprogs-5.0.0-4.el8.x86_64                          22/22

アップグレード済み:
  dnf-plugin-spacewalk-2.8.5-11.0.2.module+el8.3.0+7814+aac1f1cb.noarch
  iproute-5.4.0-1.0.1.el8.x86_64
  open-vm-tools-11.1.0-2.0.1.el8.x86_64
  plymouth-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  plymouth-scripts-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64
  python3-dnf-plugin-spacewalk-2.8.5-11.0.2.module+el8.3.0+7814+aac1f1cb.noarch
  python3-rhn-client-tools-2.8.16-13.0.3.module+el8.3.0+7814+aac1f1cb.x86_64
  python3-rhnlib-2.8.6-8.0.1.module+el8.3.0+7814+aac1f1cb.noarch
  rhn-client-tools-2.8.16-13.0.3.module+el8.3.0+7814+aac1f1cb.x86_64
  xfsprogs-5.4.0-1.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

レポジトリ一覧を確認

[root@centos8 ~]# dnf repolist
repo id           repo の名前
appstream         CentOS Linux 8 - AppStream
baseos            CentOS Linux 8 - BaseOS
extras            CentOS Linux 8 - Extras
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
ol8_latest        Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]#

両方居る。

不要なレポジトリファイルを/etc/yum.repos.d/oldに追い出す。

[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 60
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月 10 09:32 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月 10 09:32 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月 10 09:32 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月 10 09:32 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月 10 09:32 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月 10 09:32 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月 10 09:32 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月 10 09:32 CentOS-Linux-Sources.repo
-rw-r--r--. 1 root root  210 12月 10 16:28 ol8-temp.repo
-rw-r--r--. 1 root root 1786 11月  4 14:43 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  470 11月  6 11:14 uek-ol8.repo
[root@centos8 ~]# mkdir /etc/yum.repos.d/old
[root@centos8 ~]# mv /etc/yum.repos.d/CentOS-Linux-* /etc/yum.repos.d/old
[root@centos8 ~]# mv /etc/yum.repos.d/ol8-temp.repo /etc/yum.repos.d/old
[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 12
drwxr-xr-x. 2 root root 4096 12月 10 16:40 old
-rw-r--r--. 1 root root 1786 11月  4 14:43 oracle-linux-ol8.repo
-rw-r--r--. 1 root root  470 11月  6 11:14 uek-ol8.repo
[root@centos8 ~]#
[root@centos8 ~]# dnf repolist
repo id           repo の名前
ol8_UEKR6         Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream     Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
[root@centos8 ~]#

レポジトリは最小限に減った。

ちなみに現状登録されているものは下記がある。

[root@centos8 ~]# dnf repolist --all
repo id               repo の名前                                         状態
ol8_UEKR6             Latest Unbreakable Enterprise Kernel Release 6 for  有効化
ol8_UEKR6_RDMA        Oracle Linux 8 UEK6 RDMA (x86_64)                   無効化
ol8_addons            Oracle Linux 8 Addons (x86_64)                      無効化
ol8_appstream         Oracle Linux 8 Application Stream (x86_64)          有効化
ol8_baseos_latest     Oracle Linux 8 BaseOS Latest (x86_64)               有効化
ol8_codeready_builder Oracle Linux 8 CodeReady Builder (x86_64) - Unsuppo 無効化
ol8_u0_baseos_base    Oracle Linux 8 BaseOS GA (x86_64)                   無効化
ol8_u1_baseos_base    Oracle Linux 8.1 BaseOS (x86_64)                    無効化
ol8_u2_baseos_base    Oracle Linux 8.2 BaseOS (x86_64)                    無効化
ol8_u3_baseos_base    Oracle Linux 8.3 BaseOS (x86_64)                    無効化
[root@centos8 ~]#

これで再起動すればOKだろ!

とreboot…

失敗しました。

試行2

Switching from Red Hat Network (RHN) to Oracle Unbreakable Linux Network (ULN)」に記載されているRHELの手順が使えないかを検討した。

手順にある uln_register_ol8.tgz と uln_register-gnome_ol8.tgz を

[root@centos8 ~]# curl -o uln_register_ol8.tgz https://linux-update.oracle.com/rpms/uln_register_ol8.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  645k  100  645k    0     0   300k      0  0:00:02  0:00:02 --:--:--  300k
[root@centos8 ~]# curl -o uln_register-gnome_ol8.tgz https://linux-update.oracle.com/rpms/uln_register-gnome_ol8.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  125k  100  125k    0     0  77166      0  0:00:01  0:00:01 --:--:-- 77166
[root@centos8 ~]# ls -l uln*
-rw-r--r--. 1 root root 128636 12月 10 17:14 uln_register-gnome_ol8.tgz
-rw-r--r--. 1 root root 661223 12月 10 17:14 uln_register_ol8.tgz
[root@centos8 ~]#

この2ファイルには何が含まれているかを確認。

[root@centos8 ~]# tar tvfz uln_register_ol8.tgz
-rw-rw-r-- ksharma/apache 24304 2019-11-13 03:32 dnf-plugin-spacewalk-2.8.5-11.0.1.module+el8.1.0+5439+db3f5398.noarch.rpm
-rw-rw-r-- ksharma/apache 31100 2019-11-13 03:32 python3-dnf-plugin-spacewalk-2.8.5-11.0.1.module+el8.1.0+5439+db3f5398.noarch.rpm
-rw-rw-r-- ksharma/apache 39592 2019-11-13 03:32 python3-rhn-check-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache 111980 2019-11-13 03:32 python3-rhn-client-tools-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache  78792 2019-11-13 03:32 python3-rhnlib-2.8.6-8.0.1.module+el8.1.0+5439+db3f5398.noarch.rpm
-rw-rw-r-- ksharma/apache  71580 2019-11-13 03:32 python3-rhn-setup-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache  25976 2019-11-13 03:32 rhn-check-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache 395692 2019-11-13 03:32 rhn-client-tools-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache  18140 2019-11-13 03:32 rhnlib-2.8.6-8.0.1.module+el8.1.0+5439+db3f5398.noarch.rpm
-rw-rw-r-- ksharma/apache  32364 2019-11-13 03:32 rhn-setup-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
[root@centos8 ~]# tar tvfz uln_register-gnome_ol8.tgz
-rw-rw-r-- ksharma/apache 99204 2019-11-13 03:32 rhn-setup-gnome-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
-rw-rw-r-- ksharma/apache 64448 2019-11-13 03:32 python3-rhn-setup-gnome-2.8.16-13.0.1.module+el8.1.0+5439+db3f5398.x86_64.rpm
[root@centos8 ~]#

RHEL8にインストールされるRedHat Network関連プログラムをOralce LinuxのULNに置き換えるものなど uln_register関連のパッケージしか入ってない感じである。

uln_registerでユーザ登録すると/etc/yum.repos.d/にOracle Linuxの登録ユーザ向けのレポジトリファイルが作成されるようになっている。

この手順では、Oracle への登録なしに移行することはできなそうな感じである。

試行3

Oracle Linux 8のレポジトリのパッケージ一覧から oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm とredhat-release-8.3-1.0.0.1.el8.x86_64.rpmをダウンロード

[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73212  100 73212    0     0  38716      0  0:00:01  0:00:01 --:--:-- 38716
[root@centos8 ~]# ls -l oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
-rw-r--r--. 1 root root 73212 12月 10 17:54 oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm
[root@centos8 ~]# curl -O https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17540  100 17540    0     0  72181      0 --:--:-- --:--:-- --:--:-- 71885
[root@centos8 ~]# ls -l redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
-rw-r--r--. 1 root root 17540 12月 10 17:57 redhat-release-8.3-1.0.0.1.el8.x86_64.rpm
[root@centos8 ~]#

強制インストール実施

[root@centos8 ~]# rpm -Uvh oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm redhat-release-8.3-1.0.0.1.el8.x86_64.rpm --force
警告: oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ad986da3: NOKEY
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:redhat-release-2:8.3-1.0.0.1.el8 ################################# [ 50%]
   2:oraclelinux-release-8:8.3-1.0.4.e################################# [100%]
[root@centos8 ~]# rpm -qa|grep release
redhat-release-8.3-1.0.0.1.el8.x86_64
centos-linux-release-8.3-1.2011.el8.noarch
oraclelinux-release-8.3-1.0.4.el8.x86_64
[root@centos8 ~]#

centos-linux-releaseも残ってしまっている

[root@centos8 ~]# rpm -ev centos-linux-release-8.3-1.2011.el8.noarch
パッケージの準備中...
centos-linux-release-8.3-1.2011.el8.noarch
[root@centos8 ~]# rpm -qa|grep release
redhat-release-8.3-1.0.0.1.el8.x86_64
oraclelinux-release-8.3-1.0.4.el8.x86_64
[root@centos8 ~]#

削除成功

/etc/yum.repos.d/ にCentOS用ファイルが残っているので移動させる。

[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 48
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-AppStream.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-BaseOS.repo
-rw-r--r--. 1 root root 1130 11月 10 09:32 CentOS-Linux-ContinuousRelease.repo
-rw-r--r--. 1 root root  318 11月 10 09:32 CentOS-Linux-Debuginfo.repo
-rw-r--r--. 1 root root  732 11月 10 09:32 CentOS-Linux-Devel.repo
-rw-r--r--. 1 root root  704 11月 10 09:32 CentOS-Linux-Extras.repo
-rw-r--r--. 1 root root  719 11月 10 09:32 CentOS-Linux-FastTrack.repo
-rw-r--r--. 1 root root  740 11月 10 09:32 CentOS-Linux-HighAvailability.repo
-rw-r--r--. 1 root root  693 11月 10 09:32 CentOS-Linux-Media.repo
-rw-r--r--. 1 root root  706 11月 10 09:32 CentOS-Linux-Plus.repo
-rw-r--r--. 1 root root  724 11月 10 09:32 CentOS-Linux-PowerTools.repo
-rw-r--r--. 1 root root  898 11月 10 09:32 CentOS-Linux-Sources.repo
[root@centos8 ~]# mkdir /etc/yum.repos.d/old
[root@centos8 ~]# mv /etc/yum.repos.d/CentOS-Linux-* /etc/yum.repos.d/old
[root@centos8 ~]# ls -l /etc/yum.repos.d/
合計 4
drwxr-xr-x. 2 root root 4096 12月 10 18:00 old
[root@centos8 ~]#

Oracle Linux用のレポジトリファイルが何もない

[root@centos8 ~]# vi /etc/yum.repos.d/ol8-temp.repo
[root@centos8 ~]# cat /etc/yum.repos.d/ol8-temp.repo
[ol8_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[root@centos8 ~]#

登録したレポジトリにアクセスできるか確認。

[root@centos8 ~]# dnf list *release-el8
Oracle Linux 8 Latest (x86_64)                  5.0 MB/s |  27 MB     00:05
メタデータの期限切れの最終確認: 0:00:10 時間前の 2020年12月10日 18時09分35秒 に 実施しました。
利用可能なパッケージ
mysql-release-el8.src                              1.0-1.el8          ol8_latest
mysql-release-el8.x86_64                           1.0-1.el8          ol8_latest
oracle-epel-release-el8.src                        1.0-2.el8          ol8_latest
oracle-epel-release-el8.x86_64                     1.0-2.el8          ol8_latest
oracle-gluster-release-el8.src                     1.0-2.el8          ol8_latest
oracle-gluster-release-el8.x86_64                  1.0-2.el8          ol8_latest
oracle-instantclient-release-el8.src               1.0-1.el8          ol8_latest
oracle-instantclient-release-el8.x86_64            1.0-1.el8          ol8_latest
oracle-olcne-release-el8.src                       1.0-1.el8          ol8_latest
oracle-olcne-release-el8.x86_64                    1.0-1.el8          ol8_latest
oracle-release-el8.src                             1.0-1.el8          ol8_latest
oracle-release-el8.x86_64                          1.0-1.el8          ol8_latest
oracle-spacewalk-client-release-el8.src            1.0-1.el8          ol8_latest
oracle-spacewalk-client-release-el8.x86_64         1.0-1.el8          ol8_latest
oraclelinux-developer-release-el8.src              1.0-5.el8          ol8_latest
oraclelinux-developer-release-el8.x86_64           1.0-5.el8          ol8_latest
oraclelinux-release-el8.src                        1.0-14.el8         ol8_latest
oraclelinux-release-el8.x86_64                     1.0-14.el8         ol8_latest
[root@centos8 ~]#

アップデート実施してみる

[root@centos8 ~]# dnf repolist
repo id                                              repo の名前
ol8_latest                                           Oracle Linux 8 Latest (x86_64)
[root@centos8 ~]# dnf update --allowerasing
メタデータの期限切れの最終確認: 0:06:48 時間前の 2020年12月10日 18時09分35秒 に実施しました。
依存関係が解決しました。
=============================================================================================================================
 パッケージ                        アーキテクチャー バージョン                                    リポジトリー         サイズ
=============================================================================================================================
アップグレード:
 NetworkManager                    x86_64           1:1.26.0-9.0.2.el8_3                          ol8_latest           2.4 M
 NetworkManager-libnm              x86_64           1:1.26.0-9.0.2.el8_3                          ol8_latest           1.8 M
 NetworkManager-team               x86_64           1:1.26.0-9.0.2.el8_3                          ol8_latest           142 k
 NetworkManager-tui                x86_64           1:1.26.0-9.0.2.el8_3                          ol8_latest           320 k
 chrony                            x86_64           3.5-1.0.1.el8                                 ol8_latest           271 k
 coreutils                         x86_64           8.30-8.0.1.el8                                ol8_latest           1.2 M
 coreutils-common                  x86_64           8.30-8.0.1.el8                                ol8_latest           2.0 M
 dbus                              x86_64           1:1.12.8-11.0.1.el8                           ol8_latest            41 k
 dbus-common                       noarch           1:1.12.8-11.0.1.el8                           ol8_latest            45 k
 dbus-daemon                       x86_64           1:1.12.8-11.0.1.el8                           ol8_latest           240 k
 dbus-libs                         x86_64           1:1.12.8-11.0.1.el8                           ol8_latest           183 k
 dbus-tools                        x86_64           1:1.12.8-11.0.1.el8                           ol8_latest            85 k
 dbxtool                           x86_64           8-5.0.1.el8                                   ol8_latest            41 k
 dracut                            x86_64           049-95.git20200804.0.2.el8                    ol8_latest           369 k
 dracut-config-rescue              x86_64           049-95.git20200804.0.2.el8                    ol8_latest            57 k
 dracut-network                    x86_64           049-95.git20200804.0.2.el8                    ol8_latest           105 k
 dracut-squash                     x86_64           049-95.git20200804.0.2.el8                    ol8_latest            58 k
 efi-filesystem                    noarch           3-2.0.2.el8                                   ol8_latest           9.0 k
 efibootmgr                        x86_64           16-1.0.1.el8                                  ol8_latest            47 k
 firewalld                         noarch           0.8.2-2.0.1.el8                               ol8_latest           487 k
 firewalld-filesystem              noarch           0.8.2-2.0.1.el8                               ol8_latest            76 k
 fuse                              x86_64           2.9.7-12.0.2.el8                              ol8_latest            84 k
 fuse-common                       x86_64           3.2.1-12.0.2.el8                              ol8_latest            22 k
 fuse-libs                         x86_64           2.9.7-12.0.2.el8                              ol8_latest           104 k
 glibc                             x86_64           2.28-127.0.1.el8                              ol8_latest           3.6 M
 glibc-common                      x86_64           2.28-127.0.1.el8                              ol8_latest           1.3 M
 glibc-langpack-ja                 x86_64           2.28-127.0.1.el8                              ol8_latest           330 k
 grub2-common                      noarch           1:2.02-90.0.1.el8                             ol8_latest           885 k
 grub2-efi-x64                     x86_64           1:2.02-90.0.1.el8                             ol8_latest           409 k
 grub2-tools                       x86_64           1:2.02-90.0.1.el8                             ol8_latest           2.0 M
 grub2-tools-extra                 x86_64           1:2.02-90.0.1.el8                             ol8_latest           1.1 M
 grub2-tools-minimal               x86_64           1:2.02-90.0.1.el8                             ol8_latest           205 k
 grubby                            x86_64           8.40-41.0.1.el8                               ol8_latest            50 k
 iptables                          x86_64           1.8.4-15.0.1.el8                              ol8_latest           583 k
 iptables-ebtables                 x86_64           1.8.4-15.0.1.el8                              ol8_latest            71 k
 iptables-libs                     x86_64           1.8.4-15.0.1.el8                              ol8_latest           106 k
 iwl100-firmware                   noarch           999:39.31.5.1-999.5.el8                       ol8_latest           151 k
 iwl1000-firmware                  noarch           999:39.31.5.1-999.5.el8                       ol8_latest           215 k
 iwl105-firmware                   noarch           999:18.168.6.1-999.5.el8                      ol8_latest           236 k
 iwl135-firmware                   noarch           999:18.168.6.1-999.5.el8                      ol8_latest           245 k
 iwl2000-firmware                  noarch           999:18.168.6.1-999.5.el8                      ol8_latest           238 k
 iwl2030-firmware                  noarch           999:18.168.6.1-999.5.el8                      ol8_latest           247 k
 iwl3160-firmware                  noarch           999:25.30.13.0-999.5.el8                      ol8_latest           1.6 M
 iwl5000-firmware                  noarch           999:8.83.5.1_1-999.5.el8                      ol8_latest           295 k
 iwl5150-firmware                  noarch           999:8.24.2.2-999.5.el8                        ol8_latest           148 k
 iwl6000-firmware                  noarch           999:9.221.4.1-999.5.el8                       ol8_latest           168 k
 iwl6000g2a-firmware               noarch           999:18.168.6.1-999.5.el8                      ol8_latest           311 k
 iwl6050-firmware                  noarch           999:41.28.5.1-999.5.el8                       ol8_latest           244 k
 iwl7260-firmware                  noarch           999:25.30.13.0-999.5.el8                      ol8_latest            15 M
 kexec-tools                       x86_64           2.0.20-34.0.2.el8                             ol8_latest           498 k
 kmod                              x86_64           25-16.0.1.el8                                 ol8_latest           128 k
 kmod-libs                         x86_64           25-16.0.1.el8                                 ol8_latest            70 k
 libdnf                            x86_64           0.48.0-5.0.2.el8                              ol8_latest           650 k
 libgcc                            x86_64           8.3.1-5.1.0.1.el8                             ol8_latest            85 k
 libgomp                           x86_64           8.3.1-5.1.0.1.el8                             ol8_latest           211 k
 libkcapi                          x86_64           1.2.0-2.0.1.el8                               ol8_latest            48 k
 libkcapi-hmaccalc                 x86_64           1.2.0-2.0.1.el8                               ol8_latest            31 k
 libreport-filesystem              x86_64           2.9.5-15.0.1.el8                              ol8_latest            22 k
 libsss_autofs                     x86_64           2.3.0-9.0.1.el8                               ol8_latest           108 k
 libsss_certmap                    x86_64           2.3.0-9.0.1.el8                               ol8_latest           141 k
 libsss_idmap                      x86_64           2.3.0-9.0.1.el8                               ol8_latest           111 k
 libsss_nss_idmap                  x86_64           2.3.0-9.0.1.el8                               ol8_latest           118 k
 libsss_sudo                       x86_64           2.3.0-9.0.1.el8                               ol8_latest           107 k
 libstdc++                         x86_64           8.3.1-5.1.0.1.el8                             ol8_latest           458 k
 libxml2                           x86_64           2.9.7-8.0.1.el8                               ol8_latest           696 k
 libxslt                           x86_64           1.1.32-5.0.1.el8                              ol8_latest           250 k
 libzstd                           x86_64           1.4.4-1.0.1.el8                               ol8_latest           266 k
 linux-firmware                    noarch           999:20200902-999.5.gitd5f9eea5.el8            ol8_latest           122 M
 microcode_ctl                     x86_64           4:20200609-2.20201027.1.0.1.el8_3             ol8_latest           4.5 M
 mozjs60                           x86_64           60.9.0-4.0.1.el8                              ol8_latest           6.6 M
 os-prober                         x86_64           1.74-6.0.1.el8                                ol8_latest            51 k
 parted                            x86_64           3.2-38.0.1.el8                                ol8_latest           556 k
 platform-python                   x86_64           3.6.8-31.0.1.el8                              ol8_latest            83 k
 policycoreutils                   x86_64           2.9-9.0.1.el8                                 ol8_latest           377 k
 polkit                            x86_64           0.115-11.0.1.el8                              ol8_latest           154 k
 polkit-libs                       x86_64           0.115-11.0.1.el8                              ol8_latest            76 k
 python3-firewall                  noarch           0.8.2-2.0.1.el8                               ol8_latest           392 k
 python3-hawkey                    x86_64           0.48.0-5.0.2.el8                              ol8_latest           112 k
 python3-libdnf                    x86_64           0.48.0-5.0.2.el8                              ol8_latest           757 k
 python3-libs                      x86_64           3.6.8-31.0.1.el8                              ol8_latest           7.8 M
 python3-libxml2                   x86_64           2.9.7-8.0.1.el8                               ol8_latest           237 k
 selinux-policy                    noarch           3.14.3-54.0.1.el8                             ol8_latest           623 k
 selinux-policy-targeted           noarch           3.14.3-54.0.1.el8                             ol8_latest            15 M
 sssd-client                       x86_64           2.3.0-9.0.1.el8                               ol8_latest           171 k
 sssd-common                       x86_64           2.3.0-9.0.1.el8                               ol8_latest           1.5 M
 sssd-kcm                          x86_64           2.3.0-9.0.1.el8                               ol8_latest           224 k
 sssd-nfs-idmap                    x86_64           2.3.0-9.0.1.el8                               ol8_latest           105 k
 systemd                           x86_64           239-41.0.1.el8_3                              ol8_latest           3.6 M
 systemd-libs                      x86_64           239-41.0.1.el8_3                              ol8_latest           1.1 M
 systemd-pam                       x86_64           239-41.0.1.el8_3                              ol8_latest           457 k
 systemd-udev                      x86_64           239-41.0.1.el8_3                              ol8_latest           1.3 M
 tuned                             noarch           2.14.0-3.0.1.el8                              ol8_latest           294 k
 vim-minimal                       x86_64           2:8.0.1763-15.0.1.el8                         ol8_latest           572 k
依存関係のインストール:
 grub2-tools-efi                   x86_64           1:2.02-90.0.1.el8                             ol8_latest           470 k

トランザクションの概要
=============================================================================================================================
インストール     1 パッケージ
アップグレード  93 パッケージ

ダウンロードサイズの合計: 212 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/94): dbxtool-8-5.0.1.el8.x86_64.rpm                                                       160 kB/s |  41 kB     00:00
<略>

試行4

centosという名前がつくパッケージを確認して、削除

[root@centos8 ~]# rpm -qa|grep centos
centos-gpg-keys-8-2.el8.noarch
centos-linux-repos-8-2.el8.noarch
[root@centos8 ~]# rpm -ev centos-gpg-keys centos-linux-repos
パッケージの準備中...
centos-linux-repos-8-2.el8.noarch
centos-gpg-keys-1:8-2.el8.noarch
[root@centos8 ~]# rpm -qa|grep centos
[root@centos8 ~]#

Oralce Linuxのレポジトリファイルを追加

[root@centos8 ~]# rpm -qa|grep oraclelinux
oraclelinux-release-8.3-1.0.4.el8.x86_64
[root@centos8 ~]# dnf install oraclelinux-release-el8
メタデータの期限切れの最終確認: 0:22:00 時間前の 2020年12月10日 18時09分35秒 に実施しました。
依存関係が解決しました。
=========================================================================================
 パッケージ                     Arch          バージョン         リポジトリー      サイズ
=========================================================================================
インストール:
 oraclelinux-release-el8        x86_64        1.0-14.el8         ol8_latest         18 k

トランザクションの概要
=========================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 18 k
インストール済みのサイズ: 20 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
oraclelinux-release-el8-1.0-14.el8.x86_64.rpm            276 kB/s |  18 kB     00:00
-----------------------------------------------------------------------------------------
合計                                                     264 kB/s |  18 kB     00:00
警告: /var/cache/dnf/ol8_latest-e4c6155830ad002c/packages/oraclelinux-release-el8-1.0-14.el8.x86_64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ad986da3: NOKEY
Oracle Linux 8 Latest (x86_64)                           181 kB/s | 3.1 kB     00:00
GPG 鍵 0xAD986DA3 をインポート中:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                 1/1
  インストール     : oraclelinux-release-el8-1.0-14.el8.x86_64                       1/1
  scriptletの実行中: oraclelinux-release-el8-1.0-14.el8.x86_64                       1/1
  検証             : oraclelinux-release-el8-1.0-14.el8.x86_64                       1/1

インストール済み:
  oraclelinux-release-el8-1.0-14.el8.x86_64

完了しました!
[root@centos8 ~]# rpm -qa|grep oraclelinux
oraclelinux-release-el8-1.0-14.el8.x86_64
oraclelinux-release-8.3-1.0.4.el8.x86_64
[root@centos8 ~]#

アップデート!!

[root@centos8 ~]# dnf update
Oracle Linux 8 BaseOS Latest (x86_64)                    2.4 MB/s |  27 MB     00:11
Oracle Linux 8 Application Stream (x86_64)               4.4 MB/s |  21 MB     00:04
Latest Unbreakable Enterprise Kernel Release 6 for Oracl 4.5 MB/s |  11 MB     00:02
メタデータの期限切れの最終確認: 0:00:05 時間前の 2020年12月10日 18時32分52秒 に実施しました。
依存関係が解決しました。
=========================================================================================
 パッケージ              Arch   バージョン                           リポジトリー  サイズ
=========================================================================================
アップグレード:
 NetworkManager          x86_64 1:1.26.0-9.0.2.el8_3                 ol8_latest    2.4 M
 NetworkManager-libnm    x86_64 1:1.26.0-9.0.2.el8_3                 ol8_latest    1.8 M
 NetworkManager-team     x86_64 1:1.26.0-9.0.2.el8_3                 ol8_latest    142 k
 NetworkManager-tui      x86_64 1:1.26.0-9.0.2.el8_3                 ol8_latest    320 k
 chrony                  x86_64 3.5-1.0.1.el8                        ol8_latest    271 k
 coreutils               x86_64 8.30-8.0.1.el8                       ol8_latest    1.2 M
 coreutils-common        x86_64 8.30-8.0.1.el8                       ol8_latest    2.0 M
 dbus                    x86_64 1:1.12.8-11.0.1.el8                  ol8_latest     41 k
 dbus-common             noarch 1:1.12.8-11.0.1.el8                  ol8_latest     45 k
 dbus-daemon             x86_64 1:1.12.8-11.0.1.el8                  ol8_latest    240 k
 dbus-libs               x86_64 1:1.12.8-11.0.1.el8                  ol8_latest    183 k
 dbus-tools              x86_64 1:1.12.8-11.0.1.el8                  ol8_latest     85 k
 dbxtool                 x86_64 8-5.0.1.el8                          ol8_latest     41 k
 dracut                  x86_64 049-95.git20200804.0.2.el8           ol8_latest    369 k
 dracut-config-rescue    x86_64 049-95.git20200804.0.2.el8           ol8_latest     57 k
 dracut-network          x86_64 049-95.git20200804.0.2.el8           ol8_latest    105 k
 dracut-squash           x86_64 049-95.git20200804.0.2.el8           ol8_latest     58 k
 efi-filesystem          noarch 3-2.0.2.el8                          ol8_latest    9.0 k
 efibootmgr              x86_64 16-1.0.1.el8                         ol8_latest     47 k
 firewalld               noarch 0.8.2-2.0.1.el8                      ol8_latest    487 k
 firewalld-filesystem    noarch 0.8.2-2.0.1.el8                      ol8_latest     76 k
 fuse                    x86_64 2.9.7-12.0.2.el8                     ol8_latest     84 k
 fuse-common             x86_64 3.2.1-12.0.2.el8                     ol8_latest     22 k
 fuse-libs               x86_64 2.9.7-12.0.2.el8                     ol8_latest    104 k
 glibc                   x86_64 2.28-127.0.1.el8                     ol8_latest    3.6 M
 glibc-common            x86_64 2.28-127.0.1.el8                     ol8_latest    1.3 M
 glibc-langpack-ja       x86_64 2.28-127.0.1.el8                     ol8_latest    330 k
 grub2-common            noarch 1:2.02-90.0.1.el8                    ol8_latest    885 k
 grub2-efi-x64           x86_64 1:2.02-90.0.1.el8                    ol8_latest    409 k
 grub2-tools             x86_64 1:2.02-90.0.1.el8                    ol8_latest    2.0 M
 grub2-tools-extra       x86_64 1:2.02-90.0.1.el8                    ol8_latest    1.1 M
 grub2-tools-minimal     x86_64 1:2.02-90.0.1.el8                    ol8_latest    205 k
 grubby                  x86_64 8.40-41.0.1.el8                      ol8_latest     50 k
 iproute                 x86_64 5.4.0-1.0.1.el8                      ol8_UEKR6     665 k
 iptables                x86_64 1.8.4-15.0.1.el8                     ol8_latest    583 k
 iptables-ebtables       x86_64 1.8.4-15.0.1.el8                     ol8_latest     71 k
 iptables-libs           x86_64 1.8.4-15.0.1.el8                     ol8_latest    106 k
 iwl100-firmware         noarch 999:39.31.5.1-999.5.el8              ol8_latest    151 k
 iwl1000-firmware        noarch 999:39.31.5.1-999.5.el8              ol8_latest    215 k
 iwl105-firmware         noarch 999:18.168.6.1-999.5.el8             ol8_latest    236 k
 iwl135-firmware         noarch 999:18.168.6.1-999.5.el8             ol8_latest    245 k
 iwl2000-firmware        noarch 999:18.168.6.1-999.5.el8             ol8_latest    238 k
 iwl2030-firmware        noarch 999:18.168.6.1-999.5.el8             ol8_latest    247 k
 iwl3160-firmware        noarch 999:25.30.13.0-999.5.el8             ol8_latest    1.6 M
 iwl5000-firmware        noarch 999:8.83.5.1_1-999.5.el8             ol8_latest    295 k
 iwl5150-firmware        noarch 999:8.24.2.2-999.5.el8               ol8_latest    148 k
 iwl6000-firmware        noarch 999:9.221.4.1-999.5.el8              ol8_latest    168 k
 iwl6000g2a-firmware     noarch 999:18.168.6.1-999.5.el8             ol8_latest    311 k
 iwl6050-firmware        noarch 999:41.28.5.1-999.5.el8              ol8_latest    244 k
 iwl7260-firmware        noarch 999:25.30.13.0-999.5.el8             ol8_latest     15 M
 kexec-tools             x86_64 2.0.20-34.0.2.el8                    ol8_latest    498 k
 kmod                    x86_64 25-16.0.1.el8                        ol8_latest    128 k
 kmod-libs               x86_64 25-16.0.1.el8                        ol8_latest     70 k
 libdnf                  x86_64 0.48.0-5.0.2.el8                     ol8_latest    650 k
 libgcc                  x86_64 8.3.1-5.1.0.1.el8                    ol8_latest     85 k
 libgomp                 x86_64 8.3.1-5.1.0.1.el8                    ol8_latest    211 k
 libkcapi                x86_64 1.2.0-2.0.1.el8                      ol8_latest     48 k
 libkcapi-hmaccalc       x86_64 1.2.0-2.0.1.el8                      ol8_latest     31 k
 libreport-filesystem    x86_64 2.9.5-15.0.1.el8                     ol8_latest     22 k
 libsss_autofs           x86_64 2.3.0-9.0.1.el8                      ol8_latest    108 k
 libsss_certmap          x86_64 2.3.0-9.0.1.el8                      ol8_latest    141 k
 libsss_idmap            x86_64 2.3.0-9.0.1.el8                      ol8_latest    111 k
 libsss_nss_idmap        x86_64 2.3.0-9.0.1.el8                      ol8_latest    118 k
 libsss_sudo             x86_64 2.3.0-9.0.1.el8                      ol8_latest    107 k
 libstdc++               x86_64 8.3.1-5.1.0.1.el8                    ol8_latest    458 k
 libxml2                 x86_64 2.9.7-8.0.1.el8                      ol8_latest    696 k
 libxslt                 x86_64 1.1.32-5.0.1.el8                     ol8_latest    250 k
 libzstd                 x86_64 1.4.4-1.0.1.el8                      ol8_latest    266 k
 linux-firmware          noarch 999:20200902-999.5.gitd5f9eea5.el8   ol8_latest    122 M
 microcode_ctl           x86_64 4:20200609-2.20201027.1.0.1.el8_3    ol8_latest    4.5 M
 mozjs60                 x86_64 60.9.0-4.0.1.el8                     ol8_latest    6.6 M
 open-vm-tools           x86_64 11.1.0-2.0.1.el8                     ol8_appstream 716 k
 os-prober               x86_64 1.74-6.0.1.el8                       ol8_latest     51 k
 parted                  x86_64 3.2-38.0.1.el8                       ol8_latest    556 k
 platform-python         x86_64 3.6.8-31.0.1.el8                     ol8_latest     83 k
 plymouth                x86_64 0.9.4-7.20200615git1e36e30.0.1.el8   ol8_appstream 127 k
 plymouth-core-libs      x86_64 0.9.4-7.20200615git1e36e30.0.1.el8   ol8_appstream 122 k
 plymouth-scripts        x86_64 0.9.4-7.20200615git1e36e30.0.1.el8   ol8_appstream  44 k
 policycoreutils         x86_64 2.9-9.0.1.el8                        ol8_latest    377 k
 polkit                  x86_64 0.115-11.0.1.el8                     ol8_latest    154 k
 polkit-libs             x86_64 0.115-11.0.1.el8                     ol8_latest     76 k
 python3-firewall        noarch 0.8.2-2.0.1.el8                      ol8_latest    392 k
 python3-hawkey          x86_64 0.48.0-5.0.2.el8                     ol8_latest    112 k
 python3-libdnf          x86_64 0.48.0-5.0.2.el8                     ol8_latest    757 k
 python3-libs            x86_64 3.6.8-31.0.1.el8                     ol8_latest    7.8 M
 python3-libxml2         x86_64 2.9.7-8.0.1.el8                      ol8_latest    237 k
 selinux-policy          noarch 3.14.3-54.0.1.el8                    ol8_latest    623 k
 selinux-policy-targeted noarch 3.14.3-54.0.1.el8                    ol8_latest     15 M
 sssd-client             x86_64 2.3.0-9.0.1.el8                      ol8_latest    171 k
 sssd-common             x86_64 2.3.0-9.0.1.el8                      ol8_latest    1.5 M
 sssd-kcm                x86_64 2.3.0-9.0.1.el8                      ol8_latest    224 k
 sssd-nfs-idmap          x86_64 2.3.0-9.0.1.el8                      ol8_latest    105 k
 systemd                 x86_64 239-41.0.1.el8_3                     ol8_latest    3.6 M
 systemd-libs            x86_64 239-41.0.1.el8_3                     ol8_latest    1.1 M
 systemd-pam             x86_64 239-41.0.1.el8_3                     ol8_latest    457 k
 systemd-udev            x86_64 239-41.0.1.el8_3                     ol8_latest    1.3 M
 tuned                   noarch 2.14.0-3.0.1.el8                     ol8_latest    294 k
 vim-minimal             x86_64 2:8.0.1763-15.0.1.el8                ol8_latest    572 k
 xfsprogs                x86_64 5.4.0-1.0.1.el8                      ol8_UEKR6     1.1 M
依存関係のインストール:
 grub2-tools-efi         x86_64 1:2.02-90.0.1.el8                    ol8_latest    470 k

トランザクションの概要
=========================================================================================
インストール     1 パッケージ
アップグレード  99 パッケージ

ダウンロードサイズの合計: 215 M
これでよろしいですか? [y/N]: y

再起動

試行5

oraclelinux-release-el8インストールとdnf updateまでは試行4と同じ

UEKカーネルをインストールすればgrub/initrdを作り直すよね?ということでkernel-uekをインストールしてみる。

よくみたら、/etc/grub2-efi.cfg のリンク先がない

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/redhat/
合計 1860
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    1024 12月 10 19:37 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
[root@centos8 ~]# ls -l /boot/efi/EFI/centos/
合計 3580
-rwx------. 1 root root     134  8月  1 10:55 BOOTX64.CSV
-rwx------. 1 root root    6544 12月 10 16:55 grub.cfg
-rwx------. 1 root root    1024 12月 10 17:10 grubenv
-rwx------. 1 root root 1162400  8月  1 10:55 mmx64.efi
-rwx------. 1 root root 1238416  8月  1 10:55 shimx64-centos.efi
-rwx------. 1 root root 1244496  8月  1 10:55 shimx64.efi
[root@centos8 ~]#
[root@centos8 ~]# cd /boot/efi/EFI/redhat/
[root@centos8 redhat]# cp ../centos/grub.cfg .
[root@centos8 redhat]#

さて、reboot

試行6

oraclelinux-release-el8インストールとdnf updateまでは試行4と同じ

/etc/grub2-efi.cfg はどのパッケージが生成しているか確認

[root@centos8 ~]# dnf provides /etc/grub2-efi.cfg
メタデータの期限切れの最終確認: 0:00:36 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
grub2-efi-ia32-1:2.02-66.0.4.el8.x86_64 : GRUB for EFI systems.
Repo        : ol8_latest
一致:
ファイル名    : /etc/grub2-efi.cfg
<略>
grub2-efi-x64-1:2.02-90.0.1.el8.x86_64 : GRUB for EFI systems.
Repo        : ol8_baseos_latest
一致:
ファイル名    : /etc/grub2-efi.cfg

[root@centos8 ~]#

grub2-efi-x64が提供している。

Errorになっている /EFI/centos/grubx64.efi の提供元は?

[root@centos8 ~]# dnf provides /boot/efi/EFI/centos/grubx64.efi
メタデータの期限切れの最終確認: 0:05:24 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
grub2-efi-x64-1:2.02-90.el8.x86_64 : GRUB for EFI systems.
Repo        : @System
一致:
ファイル名    : /boot/efi/EFI/centos/grubx64.efi

[root@centos8 ~]#

他に/boot/efi/EFI/centos/にあるファイルを確認してみると、grub2-efi-x64 と shim-x64 による提供と判明

[root@centos8 ~]# dnf provides /boot/efi/EFI/centos/*
メタデータの期限切れの最終確認: 0:07:42 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
grub2-efi-x64-1:2.02-90.el8.x86_64 : GRUB for EFI systems.
Repo        : @System
一致:
ファイル名    : /boot/efi/EFI/centos/grubenv
ファイル名    : /boot/efi/EFI/centos/grub.cfg
ファイル名    : /boot/efi/EFI/centos/grubx64.efi
ファイル名    : /boot/efi/EFI/centos/fonts
<略>
shim-x64-15-15.el8_2.x86_64 : First-stage UEFI bootloader
Repo        : @System
一致:
ファイル名    : /boot/efi/EFI/centos/BOOTX64.CSV
ファイル名    : /boot/efi/EFI/centos/shimx64-centos.efi
ファイル名    : /boot/efi/EFI/centos/shimx64.efi
ファイル名    : /boot/efi/EFI/centos/mmx64.efi

[root@centos8 ~]#

grub2関連でインストールされているパッケージと、アップデートがあるパッケージを確認

[root@centos8 ~]# dnf list --installed grub2*
インストール済みパッケージ
grub2-common.noarch                       1:2.02-90.el8                @anaconda
grub2-efi-x64.x86_64                      1:2.02-90.el8                @anaconda
grub2-tools.x86_64                        1:2.02-90.el8                @anaconda
grub2-tools-extra.x86_64                  1:2.02-90.el8                @anaconda
grub2-tools-minimal.x86_64                1:2.02-90.el8                @anaconda
[root@centos8 ~]#  dnf list --upgrade grub2*
メタデータの期限切れの最終確認: 0:03:29 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
利用可能なアップグレード
grub2-common.noarch                 1:2.02-90.0.1.el8          ol8_latest
grub2-common.noarch                 1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-efi-x64.x86_64                1:2.02-90.0.1.el8          ol8_latest
grub2-efi-x64.x86_64                1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools.x86_64                  1:2.02-90.0.1.el8          ol8_latest
grub2-tools.x86_64                  1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools-extra.x86_64            1:2.02-90.0.1.el8          ol8_latest
grub2-tools-extra.x86_64            1:2.02-90.0.1.el8          ol8_baseos_latest
grub2-tools-minimal.x86_64          1:2.02-90.0.1.el8          ol8_latest
grub2-tools-minimal.x86_64          1:2.02-90.0.1.el8          ol8_baseos_latest
[root@centos8 ~]#  dnf list --installed shim*
インストール済みパッケージ
shim-x64.x86_64                      15-15.el8_2                       @anaconda
[root@centos8 ~]#  dnf list --upgrade shim*
メタデータの期限切れの最終確認: 0:09:27 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
エラー: 表示するための一致したパッケージはありません
[root@centos8 ~]#
[root@centos8 ~]#  dnf list  shim*
メタデータの期限切れの最終確認: 0:09:59 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
インストール済みパッケージ
shim-x64.x86_64                   15-15.el8_2                  @anaconda
利用可能なパッケージ
shim.src                          15-11.0.5                    ol8_latest
shim.src                          15-11.0.5                    ol8_baseos_latest
shim-ia32.x86_64                  15-11.0.5                    ol8_latest
shim-ia32.x86_64                  15-11.0.5                    ol8_baseos_latest
[root@centos8 ~]#

shim-x64の方はアップデートが無く、CentOS8版の方がバージョンが新しいという状況だった。

とりあえずgrub2関連をアップデート

[root@centos8 ~]# dnf update grub2*
メタデータの期限切れの最終確認: 0:11:28 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ              Arch       バージョン             リポジトリー   サイズ
================================================================================
アップグレード:
 grub2-common            noarch     1:2.02-90.0.1.el8      ol8_latest     885 k
 grub2-efi-x64           x86_64     1:2.02-90.0.1.el8      ol8_latest     409 k
 grub2-tools             x86_64     1:2.02-90.0.1.el8      ol8_latest     2.0 M
 grub2-tools-extra       x86_64     1:2.02-90.0.1.el8      ol8_latest     1.1 M
 grub2-tools-minimal     x86_64     1:2.02-90.0.1.el8      ol8_latest     205 k
依存関係のインストール:
 grub2-tools-efi         x86_64     1:2.02-90.0.1.el8      ol8_latest     470 k

トランザクションの概要
================================================================================
インストール    1 パッケージ
アップグレード  5 パッケージ

ダウンロードサイズの合計: 4.9 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/6): grub2-efi-x64-2.02-90.0.1.el8.x86_64.rpm 2.2 MB/s | 409 kB     00:00
(2/6): grub2-tools-extra-2.02-90.0.1.el8.x86_64 396 kB/s | 1.1 MB     00:02
(3/6): grub2-common-2.02-90.0.1.el8.noarch.rpm  328 kB/s | 885 kB     00:02
(4/6): grub2-tools-efi-2.02-90.0.1.el8.x86_64.r 160 kB/s | 470 kB     00:02
(5/6): grub2-tools-2.02-90.0.1.el8.x86_64.rpm   8.3 MB/s | 2.0 MB     00:00
(6/6): grub2-tools-minimal-2.02-90.0.1.el8.x86_ 121 kB/s | 205 kB     00:01
--------------------------------------------------------------------------------
合計                                            1.1 MB/s | 4.9 MB     00:04
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  scriptletの実行中: grub2-common-1:2.02-90.0.1.el8.noarch                  1/1
  アップグレード   : grub2-common-1:2.02-90.0.1.el8.noarch                 1/11
  アップグレード   : grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64          2/11
  アップグレード   : grub2-tools-extra-1:2.02-90.0.1.el8.x86_64            3/11
  scriptletの実行中: grub2-tools-1:2.02-90.0.1.el8.x86_64                  4/11
  アップグレード   : grub2-tools-1:2.02-90.0.1.el8.x86_64                  4/11
  scriptletの実行中: grub2-tools-1:2.02-90.0.1.el8.x86_64                  4/11
  アップグレード   : grub2-efi-x64-1:2.02-90.0.1.el8.x86_64                5/11
  インストール     : grub2-tools-efi-1:2.02-90.0.1.el8.x86_64              6/11
  整理             : grub2-efi-x64-1:2.02-90.el8.x86_64                    7/11
  整理             : grub2-tools-extra-1:2.02-90.el8.x86_64                8/11
  整理             : grub2-tools-minimal-1:2.02-90.el8.x86_64              9/11
  scriptletの実行中: grub2-tools-1:2.02-90.el8.x86_64                     10/11
  整理             : grub2-tools-1:2.02-90.el8.x86_64                     10/11
  整理             : grub2-common-1:2.02-90.el8.noarch                    11/11
  scriptletの実行中: grub2-common-1:2.02-90.el8.noarch                    11/11
  検証             : grub2-tools-efi-1:2.02-90.0.1.el8.x86_64              1/11
  検証             : grub2-tools-extra-1:2.02-90.0.1.el8.x86_64            2/11
  検証             : grub2-tools-extra-1:2.02-90.el8.x86_64                3/11
  検証             : grub2-efi-x64-1:2.02-90.0.1.el8.x86_64                4/11
  検証             : grub2-efi-x64-1:2.02-90.el8.x86_64                    5/11
  検証             : grub2-common-1:2.02-90.0.1.el8.noarch                 6/11
  検証             : grub2-common-1:2.02-90.el8.noarch                     7/11
  検証             : grub2-tools-1:2.02-90.0.1.el8.x86_64                  8/11
  検証             : grub2-tools-1:2.02-90.el8.x86_64                      9/11
  検証             : grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64         10/11
  検証             : grub2-tools-minimal-1:2.02-90.el8.x86_64             11/11

アップグレード済み:
  grub2-common-1:2.02-90.0.1.el8.noarch
  grub2-efi-x64-1:2.02-90.0.1.el8.x86_64
  grub2-tools-1:2.02-90.0.1.el8.x86_64
  grub2-tools-extra-1:2.02-90.0.1.el8.x86_64
  grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64

インストール済み:
  grub2-tools-efi-1:2.02-90.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

で、shim-x64をダウングレード

[root@centos8 ~]# dnf downgrade shim-x64
メタデータの期限切れの最終確認: 0:13:23 時間前の 2020年12月11日 08時46分54秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ         Arch       バージョン                  リポジトリー   サイズ
================================================================================
インストール:
 kernel             x86_64     4.18.0-193.28.1.el8_2       ol8_latest     2.8 M
 kernel-core        x86_64     4.18.0-193.28.1.el8_2       ol8_latest      28 M
 kernel-modules     x86_64     4.18.0-193.28.1.el8_2       ol8_latest      24 M
ダウングレード:
 shim-x64           x86_64     15-11.0.5                   ol8_latest     656 k

トランザクションの概要
================================================================================
インストール    3 パッケージ
ダウングレード  1 パッケージ

ダウンロードサイズの合計: 55 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/4): shim-x64-15-11.0.5.x86_64.rpm            3.5 MB/s | 656 kB     00:00
(2/4): kernel-4.18.0-193.28.1.el8_2.x86_64.rpm  711 kB/s | 2.8 MB     00:04
(3/4): kernel-modules-4.18.0-193.28.1.el8_2.x86 4.2 MB/s |  24 MB     00:05
(4/4): kernel-core-4.18.0-193.28.1.el8_2.x86_64 4.7 MB/s |  28 MB     00:06
--------------------------------------------------------------------------------
合計                                            9.1 MB/s |  55 MB     00:06
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  インストール     : kernel-core-4.18.0-193.28.1.el8_2.x86_64               1/5
  scriptletの実行中: kernel-core-4.18.0-193.28.1.el8_2.x86_64               1/5
  インストール     : kernel-modules-4.18.0-193.28.1.el8_2.x86_64            2/5
  scriptletの実行中: kernel-modules-4.18.0-193.28.1.el8_2.x86_64            2/5
  インストール     : kernel-4.18.0-193.28.1.el8_2.x86_64                    3/5
  ダウングレード   : shim-x64-15-11.0.5.x86_64                              4/5
  整理             : shim-x64-15-15.el8_2.x86_64                            5/5
  scriptletの実行中: kernel-core-4.18.0-193.28.1.el8_2.x86_64               5/5
  scriptletの実行中: shim-x64-15-15.el8_2.x86_64                            5/5
  検証             : shim-x64-15-11.0.5.x86_64                              1/5
  検証             : shim-x64-15-15.el8_2.x86_64                            2/5
  検証             : kernel-4.18.0-193.28.1.el8_2.x86_64                    3/5
  検証             : kernel-core-4.18.0-193.28.1.el8_2.x86_64               4/5
  検証             : kernel-modules-4.18.0-193.28.1.el8_2.x86_64            5/5

ダウングレード済み:
  shim-x64-15-11.0.5.x86_64

インストール済み:
  kernel-4.18.0-193.28.1.el8_2.x86_64
  kernel-core-4.18.0-193.28.1.el8_2.x86_64
  kernel-modules-4.18.0-193.28.1.el8_2.x86_64

完了しました!
[root@centos8 ~]#

一緒にkernelもOracle Linuxのものに差し替えてくれた。

しかし、/etc/grub2-efi.cfg のリンク先が存在しない状況は変わらず

[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月 6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx——. 1 root root 1216760 7月 25 03:42 BOOTX64.EFI
-rwx——. 1 root root 361600 7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx——. 1 root root 6544 12月 10 16:55 grub.cfg
-rwx——. 1 root root 1024 12月 10 17:10 grubenv

/boot/efi/EFI/redhat:
合計 4196
-rwx——. 1 root root 134 7月 25 03:42 BOOTX64.CSV
drwx——. 2 root root 4096 11月 6 04:56 fonts
-rwx——. 1 root root 1024 12月 11 09:00 grubenv
-rwx——. 1 root root 1895592 11月 6 04:56 grubx64.efi
-rwx——. 1 root root 1165032 7月 25 03:42 mmx64.efi
-rwx——. 1 root root 1216760 7月 25 03:42 shimx64.efi
[root@centos8 ~]#

これについてはgrub2-mkconfig で再作成で対応できる?

[root@centos8 ~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for EFI firmware configuration
done
[root@centos8 ~]# ls -l /boot/efi/EFI/*
/boot/efi/EFI/BOOT:
合計 1548
-rwx------. 1 root root 1216760  7月 25 03:42 BOOTX64.EFI
-rwx------. 1 root root  361600  7月 25 03:42 fbx64.efi

/boot/efi/EFI/centos:
合計 12
-rwx------. 1 root root 6544 12月 10 16:55 grub.cfg
-rwx------. 1 root root 1024 12月 10 17:10 grubenv

/boot/efi/EFI/redhat:
合計 4204
-rwx------. 1 root root     134  7月 25 03:42 BOOTX64.CSV
drwx------. 2 root root    4096 11月  6 04:56 fonts
-rwx------. 1 root root    6544 12月 11 09:03 grub.cfg
-rwx------. 1 root root    1024 12月 11 09:03 grubenv
-rwx------. 1 root root 1895592 11月  6 04:56 grubx64.efi
-rwx------. 1 root root 1165032  7月 25 03:42 mmx64.efi
-rwx------. 1 root root 1216760  7月 25 03:42 shimx64.efi
[root@centos8 ~]# ls -l /etc/grub2-efi.cfg
lrwxrwxrwx. 1 root root 31 11月  6 04:56 /etc/grub2-efi.cfg -> ../boot/efi/EFI/redhat/grub.cfg
[root@centos8 ~]#

対応できたようだ。

再起動

grubメニューに「Oracle Linux Server」が登場して起動してきた。

改めてパッケージ更新実行

[root@centos8 ~]# dnf update
メタデータの期限切れの最終確認: 0:02:02 時間前の 2020年12月11日 09時03分56秒 に 実施しました。
依存関係が解決しました。
================================================================================
 パッケージ          Arch   バージョン                         Repo       サイズ
================================================================================
アップグレード:
 NetworkManager      x86_64 1:1.26.0-9.0.2.el8_3               ol8_latest 2.4 M
 NetworkManager-libnm
                     x86_64 1:1.26.0-9.0.2.el8_3               ol8_latest 1.8 M
 NetworkManager-team x86_64 1:1.26.0-9.0.2.el8_3               ol8_latest 142 k
 NetworkManager-tui  x86_64 1:1.26.0-9.0.2.el8_3               ol8_latest 320 k
 chrony              x86_64 3.5-1.0.1.el8                      ol8_latest 271 k
 coreutils           x86_64 8.30-8.0.1.el8                     ol8_latest 1.2 M
 coreutils-common    x86_64 8.30-8.0.1.el8                     ol8_latest 2.0 M
 dbus                x86_64 1:1.12.8-11.0.1.el8                ol8_latest  41 k
 dbus-common         noarch 1:1.12.8-11.0.1.el8                ol8_latest  45 k
 dbus-daemon         x86_64 1:1.12.8-11.0.1.el8                ol8_latest 240 k
 dbus-libs           x86_64 1:1.12.8-11.0.1.el8                ol8_latest 183 k
 dbus-tools          x86_64 1:1.12.8-11.0.1.el8                ol8_latest  85 k
 dbxtool             x86_64 8-5.0.1.el8                        ol8_latest  41 k
 dracut              x86_64 049-95.git20200804.0.2.el8         ol8_latest 369 k
 dracut-config-rescue
                     x86_64 049-95.git20200804.0.2.el8         ol8_latest  57 k
 dracut-network      x86_64 049-95.git20200804.0.2.el8         ol8_latest 105 k
 dracut-squash       x86_64 049-95.git20200804.0.2.el8         ol8_latest  58 k
 efi-filesystem      noarch 3-2.0.2.el8                        ol8_latest 9.0 k
 efibootmgr          x86_64 16-1.0.1.el8                       ol8_latest  47 k
 firewalld           noarch 0.8.2-2.0.1.el8                    ol8_latest 487 k
 firewalld-filesystem
                     noarch 0.8.2-2.0.1.el8                    ol8_latest  76 k
 fuse                x86_64 2.9.7-12.0.2.el8                   ol8_latest  84 k
 fuse-common         x86_64 3.2.1-12.0.2.el8                   ol8_latest  22 k
 fuse-libs           x86_64 2.9.7-12.0.2.el8                   ol8_latest 104 k
 glibc               x86_64 2.28-127.0.1.el8                   ol8_latest 3.6 M
 glibc-common        x86_64 2.28-127.0.1.el8                   ol8_latest 1.3 M
 glibc-langpack-ja   x86_64 2.28-127.0.1.el8                   ol8_latest 330 k
 grubby              x86_64 8.40-41.0.1.el8                    ol8_latest  50 k
 iproute             x86_64 5.4.0-1.0.1.el8                    ol8_UEKR6  665 k
 iptables            x86_64 1.8.4-15.0.1.el8                   ol8_latest 583 k
 iptables-ebtables   x86_64 1.8.4-15.0.1.el8                   ol8_latest  71 k
 iptables-libs       x86_64 1.8.4-15.0.1.el8                   ol8_latest 106 k
 iwl100-firmware     noarch 999:39.31.5.1-999.5.el8            ol8_latest 151 k
 iwl1000-firmware    noarch 999:39.31.5.1-999.5.el8            ol8_latest 215 k
 iwl105-firmware     noarch 999:18.168.6.1-999.5.el8           ol8_latest 236 k
 iwl135-firmware     noarch 999:18.168.6.1-999.5.el8           ol8_latest 245 k
 iwl2000-firmware    noarch 999:18.168.6.1-999.5.el8           ol8_latest 238 k
 iwl2030-firmware    noarch 999:18.168.6.1-999.5.el8           ol8_latest 247 k
 iwl3160-firmware    noarch 999:25.30.13.0-999.5.el8           ol8_latest 1.6 M
 iwl5000-firmware    noarch 999:8.83.5.1_1-999.5.el8           ol8_latest 295 k
 iwl5150-firmware    noarch 999:8.24.2.2-999.5.el8             ol8_latest 148 k
 iwl6000-firmware    noarch 999:9.221.4.1-999.5.el8            ol8_latest 168 k
 iwl6000g2a-firmware noarch 999:18.168.6.1-999.5.el8           ol8_latest 311 k
 iwl6050-firmware    noarch 999:41.28.5.1-999.5.el8            ol8_latest 244 k
 iwl7260-firmware    noarch 999:25.30.13.0-999.5.el8           ol8_latest  15 M
 kexec-tools         x86_64 2.0.20-34.0.2.el8                  ol8_latest 498 k
 kmod                x86_64 25-16.0.1.el8                      ol8_latest 128 k
 kmod-libs           x86_64 25-16.0.1.el8                      ol8_latest  70 k
 libdnf              x86_64 0.48.0-5.0.2.el8                   ol8_latest 650 k
 libgcc              x86_64 8.3.1-5.1.0.1.el8                  ol8_latest  85 k
 libgomp             x86_64 8.3.1-5.1.0.1.el8                  ol8_latest 211 k
 libkcapi            x86_64 1.2.0-2.0.1.el8                    ol8_latest  48 k
 libkcapi-hmaccalc   x86_64 1.2.0-2.0.1.el8                    ol8_latest  31 k
 libreport-filesystem
                     x86_64 2.9.5-15.0.1.el8                   ol8_latest  22 k
 libsss_autofs       x86_64 2.3.0-9.0.1.el8                    ol8_latest 108 k
 libsss_certmap      x86_64 2.3.0-9.0.1.el8                    ol8_latest 141 k
 libsss_idmap        x86_64 2.3.0-9.0.1.el8                    ol8_latest 111 k
 libsss_nss_idmap    x86_64 2.3.0-9.0.1.el8                    ol8_latest 118 k
 libsss_sudo         x86_64 2.3.0-9.0.1.el8                    ol8_latest 107 k
 libstdc++           x86_64 8.3.1-5.1.0.1.el8                  ol8_latest 458 k
 libxml2             x86_64 2.9.7-8.0.1.el8                    ol8_latest 696 k
 libxslt             x86_64 1.1.32-5.0.1.el8                   ol8_latest 250 k
 libzstd             x86_64 1.4.4-1.0.1.el8                    ol8_latest 266 k
 linux-firmware      noarch 999:20200902-999.5.gitd5f9eea5.el8 ol8_latest 122 M
 microcode_ctl       x86_64 4:20200609-2.20201027.1.0.1.el8_3  ol8_latest 4.5 M
 mozjs60             x86_64 60.9.0-4.0.1.el8                   ol8_latest 6.6 M
 open-vm-tools       x86_64 11.1.0-2.0.1.el8                   ol8_appstream
                                                                          716 k
 os-prober           x86_64 1.74-6.0.1.el8                     ol8_latest  51 k
 parted              x86_64 3.2-38.0.1.el8                     ol8_latest 556 k
 platform-python     x86_64 3.6.8-31.0.1.el8                   ol8_latest  83 k
 plymouth            x86_64 0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream
                                                                          127 k
 plymouth-core-libs  x86_64 0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream
                                                                          122 k
 plymouth-scripts    x86_64 0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream
                                                                           44 k
 policycoreutils     x86_64 2.9-9.0.1.el8                      ol8_latest 377 k
 polkit              x86_64 0.115-11.0.1.el8                   ol8_latest 154 k
 polkit-libs         x86_64 0.115-11.0.1.el8                   ol8_latest  76 k
 python3-firewall    noarch 0.8.2-2.0.1.el8                    ol8_latest 392 k
 python3-hawkey      x86_64 0.48.0-5.0.2.el8                   ol8_latest 112 k
 python3-libdnf      x86_64 0.48.0-5.0.2.el8                   ol8_latest 757 k
 python3-libs        x86_64 3.6.8-31.0.1.el8                   ol8_latest 7.8 M
 python3-libxml2     x86_64 2.9.7-8.0.1.el8                    ol8_latest 237 k
 selinux-policy      noarch 3.14.3-54.0.1.el8                  ol8_latest 623 k
 selinux-policy-targeted
                     noarch 3.14.3-54.0.1.el8                  ol8_latest  15 M
 sssd-client         x86_64 2.3.0-9.0.1.el8                    ol8_latest 171 k
 sssd-common         x86_64 2.3.0-9.0.1.el8                    ol8_latest 1.5 M
 sssd-kcm            x86_64 2.3.0-9.0.1.el8                    ol8_latest 224 k
 sssd-nfs-idmap      x86_64 2.3.0-9.0.1.el8                    ol8_latest 105 k
 systemd             x86_64 239-41.0.1.el8_3                   ol8_latest 3.6 M
 systemd-libs        x86_64 239-41.0.1.el8_3                   ol8_latest 1.1 M
 systemd-pam         x86_64 239-41.0.1.el8_3                   ol8_latest 457 k
 systemd-udev        x86_64 239-41.0.1.el8_3                   ol8_latest 1.3 M
 tuned               noarch 2.14.0-3.0.1.el8                   ol8_latest 294 k
 vim-minimal         x86_64 2:8.0.1763-15.0.1.el8              ol8_latest 572 k
 xfsprogs            x86_64 5.4.0-1.0.1.el8                    ol8_UEKR6  1.1 M

トランザクションの概要
================================================================================
アップグレード  94 パッケージ

ダウンロードサイズの合計: 210 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
(1/94): efi-filesystem-3-2.0.2.el8.noarch.rpm    84 kB/s | 9.0 kB     00:00
<略>
  tuned-2.14.0-3.0.1.el8.noarch
  vim-minimal-2:8.0.1763-15.0.1.el8.x86_64
  xfsprogs-5.4.0-1.0.1.el8.x86_64

完了しました!
[root@centos8 ~]#

再起動

成功

CentOS 7 / Oracle Linux 7でWordPressサーバを建てる


この間、Oracle Linux 7ベースのOracle Autonomouse Linux 環境にWordPressサーバを建てる手順を書いたけど、そういえばベースとなるCent OS 7(Oracle Linux 7)環境でWordpressサーバを建てる手順を書いたことなかったな、と書いてみる。

前準備

CentOS7として基本的な設定を行っていく。

準備1:パッケージのアップデート

インストール済みのパッケージを最新にするため「yum update」を実行する

$ sudo yum update -y

準備2:日本時間にする

日本に住んでいる場合、日本時間表記の方が使いやすいので、OSも日本時間表示に設定する。

$ sudo timedatectl set-timezone Japan

変更されたことを確認するには「timedatectl」を実行する。

$ timedatectl
      Local time: Tue 2020-07-07 10:04:40 JST
  Universal time: Tue 2020-07-07 01:04:40 UTC
        RTC time: Tue 2020-07-07 01:04:38
       Time zone: Japan (JST, +0900)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a
$

準備3:パッケージの自動アップデート設定をする

方針にもよりますが、最近は死ぬパッケージが配布されることは少ないので、自動アップデートしてしまえ、と、yum-cronによる自動アップデート設定を入れています。

まず、yum-cron パッケージをインストールします。

$ sudo yum install yum-cron

次に /etc/yum/yum-cron.conf を編集して自動アップデートを有効にします。

$ sudo vi /etc/yum/yum-cron.conf

ファイル内にある「apply_updates = no」を「apply_updates = yes」に変更します。

変更後の該当部分は以下の様になります。

# Whether updates should be applied when they are available.  Note
# that download_updates must also be yes for the update to be applied.
apply_updates = yes

準備4:EPELレポジトリの追加

EPELレポジトリが必要になるので追加します。

$ sudo yum install epel-release

注:RHEL 7の場合は epelパッケージをダウンロードしてインストールします。

また、後述するphpおよびMariaDBのインストールでは、ol7_addons収録のoniguruma-5.9.5 を使用します。epel収録のoniguruma-6.8.2では依存関係解決でエラーとなりますので、epel収録のonigurumaを使用しないよう設定します。

設定は /etc/yum.repos.d/epel.repo の[epel]に対して「exclude=oniguruma」という記述を追加します。

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
exclude=oniguruma

インターネット公開用準備

インターネット公開にあたりやっておいた方が良いことです。

fail2ban導入

公開サーバには各種アタックが頻繁にやってきます。管理用sshポートにも行われ無駄にCPU資源とトラフィックを食われます。

多少なりとも低減した方がいいので、fail2banというEPELレポジトリに含まれるソフトウェアを導入します。

fail2banは、ログイン失敗ログなどを監視し、一定数を超えたら該当するIPアドレスからのアクセスを一定期間受け付けなくする仕組みです。

$  sudo yum install fail2ban

fail2banの設定は /etc/fail2ban/ にあり、fail2ban.confやjail.confなどがあります。

しかし、ユーザ側で設定を追加修正したい場合はこれらのファイルを直接編集するのではなく、 /etc/fail2ban/jail.local というファイルを作成してそこに行っていきます。

$ sudo vi /etc/fail2ban/jail.local

/etc/fail2ban/jail.localには下記の様な内容を記載します。

[DEFAULT]
# 86400秒=24時間以内に5回不審なアクセスがあったら24時間BAN
bantime  = 86400
findtime  = 86400
maxretry = 5
# 259200秒=3日以内に5回不審なアクセスがあったら3日間BAN
#bantime  = 259200
#findtime  = 259200
#maxretry = 5

# 除外IP
ignoreip = 127.0.0.1 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 <既知>の固定IPがあれば追加>

[sshd]
enabled = true
banaction = firewallcmd-ipset

bantime/findtimeは2種類書いてありますが、まずは24時間で設定して、管理アクセス等に問題がないことを確認したら3日に変更するなどしてください。

設定が終わったらfail2banサービスを起動するための設定を入れていきます。

まず、初期状態は起動しない設定であるためenableに変更します。

$ systemctl list-unit-files|grep fail
fail2ban.service                              disabled
$ sudo systemctl enable fail2ban.service
Created symlink from /etc/systemd/system/multi-user.target.wants/fail2ban.service to /usr/lib/systemd/system/fail2ban.service.
$ systemctl list-unit-files|grep fail
fail2ban.service                              enabled
$

次にfail2banを起動します。

$ systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:fail2ban(1)
$ sudo systemctl start fail2ban.service
$ systemctl status fail2ban.service
● fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-07-07 10:23:36 JST; 2s ago
     Docs: man:fail2ban(1)
  Process: 2099 ExecStartPre=/bin/mkdir -p /run/fail2ban (code=exited, status=0/SUCCESS)
 Main PID: 2100 (f2b/server)
   CGroup: /system.slice/fail2ban.service
           mq2100 /usr/bin/python -s /usr/bin/fail2ban-server -xf start

Jul 07 10:23:36 phoenix-websa-jp systemd[1]: Starting Fail2Ban Service...
Jul 07 10:23:36 phoenix-websa-jp systemd[1]: Started Fail2Ban Service.
Jul 07 10:23:37 phoenix-websa-jp fail2ban-server[2100]: Server ready

動作確認を行います。

わざとパスワードを間違えるなどして /var/log/fail2ban.log にログが出力されることを確認します。

Webサーバ用ポート公開設定

標準ではdhcpv6-clientとsshのポートしか公開されていないため、Webサーバを建てても外部からアクセスできません。

http(ポート80)とhttps(ポート443)を公開する設定を行います。

まず現状を確認します。

$ sudo firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens3
  sources:
  services: dhcpv6-client ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
$ 

httpとhttpsの公開設定を入れます。

$ sudo firewall-cmd --permanent --zone=public --add-service=http
success
$ sudo firewall-cmd --permanent --zone=public --add-service=https
success
$

reloadを行って設定を反映します。

$ sudo firewall-cmd --reload
success
$ sudo firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens3
  sources:
  services: dhcpv6-client http https ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
$

php 7.4追加編

Oralce Linux 7だと簡単に追加できたりするPHP Packages for Oracle Linuxを利用する。

/etc/yum.repos.d/oracle-php.repo というファイルを作って下記を記載する。(sudo vi /etc/yum.repos.d/oracle-php.repo )

[ol7_developer_php74]
name=Oracle Linux $releasever PHP 7.4 Packages for Development and test ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/developer/php74/$basearch/
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1

[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1

上記では「ol7_developer_php74」と「ol7_addons」を追加しているが、ol7_addonsの方はMariaDBのインストール時にも必要になるレポジトリとなる。

phpをインストールします。あとでWordpressから要求されるパッケージもあるのでいろいろインストールします。(php-pecl-imagick と php-mbstring はパッケージの依存の問題でインストール不可だった )

$ sudo yum install php php-json php-bcmath php-pear-Net-Curl php-gd php-mbstring
<略>
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch   Version               Repository           Size
================================================================================
Installing:
 php                     x86_64 7.4.7-1.0.1.el7       ol7_developer_php74 3.4 M
 php-bcmath              x86_64 7.4.7-1.0.1.el7       ol7_developer_php74  56 k
 php-gd                  x86_64 7.4.7-1.0.1.el7       ol7_developer_php74  72 k
 php-json                x86_64 7.4.7-1.0.1.el7       ol7_developer_php74  58 k
 php-pear-Net-Curl       noarch 1.2.5-10.el7          epel                 13 k
 php-mbstring            x86_64 7.4.7-1.0.1.el7       ol7_developer_php74  500 k
Installing for dependencies:
 apr                     x86_64 1.4.8-5.el7           base                103 k
 apr-util                x86_64 1.5.2-6.el7           base                 92 k
 dejavu-fonts-common     noarch 2.33-6.el7            base                 64 k
 dejavu-sans-fonts       noarch 2.33-6.el7            base                1.4 M
 fontconfig              x86_64 2.13.0-4.3.el7        base                254 k
 fontpackages-filesystem noarch 1.44-8.el7            base                9.9 k
 gd-last                 x86_64 2.1.1-2.el7           ol7_developer_php74 140 k
 httpd                   x86_64 2.4.6-93.el7.centos   base                2.7 M
 httpd-tools             x86_64 2.4.6-93.el7.centos   base                 92 k
 jbigkit-libs            x86_64 2.0-11.el7            base                 46 k
 libX11                  x86_64 1.6.7-2.el7           base                607 k
 libX11-common           noarch 1.6.7-2.el7           base                164 k
 libXau                  x86_64 1.0.8-2.1.el7         base                 29 k
 libXpm                  x86_64 3.5.12-1.el7          base                 55 k
 libjpeg-turbo           x86_64 1.2.90-8.el7          base                135 k
 libtiff                 x86_64 4.0.3-32.el7          base                171 k
 libvpx                  x86_64 1.3.0-5.el7_0         base                498 k
 libxcb                  x86_64 1.13-1.el7            base                214 k
 libxslt                 x86_64 1.1.28-5.el7          base                242 k
 mailcap                 noarch 2.1.41-2.el7          base                 31 k
 php-cli                 x86_64 7.4.7-1.0.1.el7       ol7_developer_php74 5.1 M
 php-common              x86_64 7.4.7-1.0.1.el7       ol7_developer_php74 1.1 M
 php-pear                noarch 1:1.9.4-21.el7        base                357 k
 php-process             x86_64 7.4.7-1.0.1.el7       ol7_developer_php74  76 k
 php-xml                 x86_64 7.4.7-1.0.1.el7       ol7_developer_php74 185 k
 oniguruma               x86_64 5.9.5-3.el7           ol7_addons          128 k

Transaction Summary
================================================================================
Install  6 Packages (+26 Dependent packages)

Total download size: 17 M
Installed size: 68 M
Is this ok [y/d/N]: y
<略>
$

この操作によりWebサーバもインストールされている。

なお、php-mbstringのインストールで失敗する場合、epel収録のoniguruma 6がインストールされているか、oniguruma 5がレポジトリ内に見つからない、というものです。

oniguruma 5はol7_addonに含まれます。

MariaDB設定編

CentOS7ではmariadb 5.5.65が用意されている。しかし、このバージョンはWordPress推奨ではないため、最新版のMariaDBをMariaDB Foundationから入手しインストールする。

「/etc/yum.repos.d/mariadb.repo」というファイルを作り、以下の内容を入力。(sudo vi /etc/yum.repos.d/mariadb.repo)

# MariaDB 10.5 CentOS repository list - created 2020-07-07 02:24 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

そして、mariadb-serverをインストールします。

$ sudo yum install MariaDB-server MariaDB-client
<略>
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                    Arch      Version                  Repository  Size
================================================================================
Installing:
 MariaDB-client             x86_64    10.5.4-1.el7.centos      mariadb     13 M
 MariaDB-compat             x86_64    10.5.4-1.el7.centos      mariadb    2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.65-1.el7
 MariaDB-server             x86_64    10.5.4-1.el7.centos      mariadb     26 M
Installing for dependencies:
 MariaDB-common             x86_64    10.5.4-1.el7.centos      mariadb     81 k
 boost-program-options      x86_64    1.53.0-28.el7            base       156 k
 galera-4                   x86_64    26.4.5-1.el7.centos      mariadb    9.5 M
 pcre2                      x86_64    10.23-2.el7              base       201 k
 perl-Compress-Raw-Bzip2    x86_64    2.061-3.el7              base        32 k
 perl-Compress-Raw-Zlib     x86_64    1:2.061-4.el7            base        57 k
 perl-DBI                   x86_64    1.627-4.el7              base       802 k
 perl-Data-Dumper           x86_64    2.145-3.el7              base        47 k
 perl-IO-Compress           noarch    2.061-2.el7              base       260 k
 perl-Net-Daemon            noarch    0.48-5.el7               base        51 k
 perl-PlRPC                 noarch    0.2020-14.el7            base        36 k
 socat                      x86_64    1.7.3.2-2.el7            base       290 k

Transaction Summary
================================================================================
Install  3 Packages (+12 Dependent packages)

Total download size: 52 M
Is this ok [y/d/N]: y
<略>
$

MariaDBサーバの自動起動を設定します。

$ systemctl list-unit-files|grep mariadb
mariadb.service                               disabled
mariadb@.service                              disabled
$ sudo systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
$ systemctl list-unit-files|grep mariadb
mariadb.service                               enabled
mariadb@.service                              disabled
$

MariaDBを起動します。

$ systemctl status mariadb.service
● mariadb.service - MariaDB 10.5.4 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           mqmigrated-from-my.cnf-settings.conf
   Active: inactive (dead)
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
$ sudo systemctl start mariadb.service
$ systemctl status mariadb.service
● mariadb.service - MariaDB 10.5.4 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           mqmigrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2020-07-07 11:30:10 JST; 1s ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 32580 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 32554 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 32552 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 32565 (mariadbd)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           mq32565 /usr/sbin/mariadbd

Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: 2020-07-07 11:30:10 0 [Note...
Jul 07 11:30:10 phoenix-websa-jp mariadbd[32565]: Version: '10.5.4-MariaDB'  ...
Jul 07 11:30:10 phoenix-websa-jp systemd[1]: Started MariaDB 10.5.4 database....
Hint: Some lines were ellipsized, use -l to show in full.
$

最後にWordpress用データベースを作成します。

$ sudo mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.4-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database DB名 character set utf8;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> grant all on DB名.* to wordpress@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> quit
Bye
$

Webサーバ SSL設定編

昨今のWebサーバはSSL化が必須です。

Let’s Encriptを利用したSSL化が使用しやすいですが、certbotだと仕組みが大がかりになってしまうので小回りが利くshellベースのdehydratedを使用します。

EPELレポジトリに含まれているため導入は簡単です。

$ sudo yum install dehydrated
<略>--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch            Version                Repository     Size
================================================================================
Installing:
 dehydrated          noarch          0.6.5-1.el7            epel           85 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 85 k
Installed size: 164 k
Is this ok [y/d/N]: y
<略>
$

dehydratedによるSSL証明書取得処理には /var/www/dehydrated が使用されるためディレクトリを作成します。

$ sudo mkdir  /var/www/dehydrated

http://~/.well-known/acme-challenge でアクセスした時に上記ディレクトリが開くようApacheの設定を /etc/httpd/conf.d/dehydrated.conf として作成します。(sudo vi /etc/httpd/conf.d/dehydrated.conf )

Alias /.well-known/acme-challenge /var/www/dehydrated
<Directory /var/www/dehydrated/>
</Directory>

Webサーバが自動起動するように設定します。

$ systemctl list-unit-files |grep http
httpd.service                                 disabled
$ sudo systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
$ systemctl list-unit-files |grep http
httpd.service                                 enabled
$

続いてWebサーバを起動します。

$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:httpd(8)
           man:apachectl(8)
$ sudo systemctl start httpd.service
$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-07-07 10:55:23 JST; 14s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 30854 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           tq30854 /usr/sbin/httpd -DFOREGROUND
           tq30855 /usr/sbin/httpd -DFOREGROUND
           tq30856 /usr/sbin/httpd -DFOREGROUND
           tq30857 /usr/sbin/httpd -DFOREGROUND
           tq30858 /usr/sbin/httpd -DFOREGROUND
           mq30859 /usr/sbin/httpd -DFOREGROUND

Jul 07 10:55:22 phoenix-websa-jp systemd[1]: Starting The Apache HTTP Server...
Jul 07 10:55:23 phoenix-websa-jp systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
$

SSL証明書を発行するホスト名を /etc/dehydrated/domains.txt に記載する。(sudo vi /etc/dehydrated/domains.txt)

1行に複数のホスト名を記載するとaliasになります。

登録作業を開始します。

$ sudo dehydrated --register
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh

To use dehydrated with this certificate authority you have to agree to their terms of service which you can find here: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf

To accept these terms of service run `/bin/dehydrated --register --accept-terms`.
$
$ sudo dehydrated --register --accept-terms
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh
+ Generating account key...
+ Registering account key with ACME server...
+ Fetching account ID...
+ Done!
$

初回のSSL証明書発行処理を実行します。

$ sudo dehydrated --cron
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh
 + Creating chain cache directory /etc/dehydrated/chains
Processing phoenix.websa.jp
 + Creating new directory /etc/dehydrated/certs/phoenix.websa.jp ...
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 1 authorizations URLs from the CA
 + Handling authorization for phoenix.websa.jp
 + 1 pending challenge(s)
 + Deploying challenge tokens...
 + Responding to challenge for phoenix.websa.jp authorization...
 + Challenge is valid!
 + Cleaning challenge tokens...
 + Requesting certificate...
 + Checking certificate...
 + Done!
 + Creating fullchain.pem...
 + Done!
$

/etc/dehydrated/certs/ にdomais.txtの各行の一番最初に書いたホスト名のディレクトリが作られており、その中に証明書が配置されています。

$ sudo ls -l /etc/dehydrated/certs/
total 0
drwx------. 2 root root 239 Jul  7 11:04 phoenix.websa.jp
$ sudo ls -l /etc/dehydrated/certs/phoenix.websa.jp/
total 20
-rw-------. 1 root root 1655 Jul  7 11:04 cert-1594087457.csr
-rw-------. 1 root root 2256 Jul  7 11:04 cert-1594087457.pem
lrwxrwxrwx. 1 root root   19 Jul  7 11:04 cert.csr -> cert-1594087457.csr
lrwxrwxrwx. 1 root root   19 Jul  7 11:04 cert.pem -> cert-1594087457.pem
-rw-------. 1 root root 1648 Jul  7 11:04 chain-1594087457.pem
lrwxrwxrwx. 1 root root   20 Jul  7 11:04 chain.pem -> chain-1594087457.pem
-rw-------. 1 root root 3904 Jul  7 11:04 fullchain-1594087457.pem
lrwxrwxrwx. 1 root root   24 Jul  7 11:04 fullchain.pem -> fullchain-1594087457.pem
-rw-------. 1 root root 3243 Jul  7 11:04 privkey-1594087457.pem
lrwxrwxrwx. 1 root root   22 Jul  7 11:04 privkey.pem -> privkey-1594087457.pem
$

なお、Let’s EncryptのSSL証明書は有効期限90日ですが、 /etc/cron.d/dehydrated に更新処理が設定されています。

Apacheに対する設定変更

phpインストール時に導入されたのはhttpのみで、httpsアクセスに関連するモジュール(mod_ssl)はインストールされていません。

$ sudo yum install mod_ssl
<略>
$

mod_sslによりSSL設定ファイルが /etc/httpd/conf.d/ssl.conf に配置されます。

しかし今どきじゃないようなので、ApacheのSSL対応設定をMozilla SSL Configuration Generatorベースの設定をssl-mozilla.confとして記載します。

$ sudo vi /etc/httpd/conf.d/ssl-mozilla.conf 

記載する内容は下記の様になる。

# generated 2020-07-07, Mozilla Guideline v5.4, Apache 2.4.6, OpenSSL 1.0.2k, intermediate configuration, no OCSP
# https://ssl-config.mozilla.org/#server=apache&version=2.4.6&config=intermediate&openssl=1.0.2k&ocsp=false&guideline=5.4

# this configuration requires mod_ssl, mod_rewrite, and mod_headers
<VirtualHost *:80>
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile      /etc/dehydrated/certs/<ホスト名>/cert.pem
    SSLCertificateChainFile /etc/dehydrated/certs/<ホスト名>/chain.pem
    SSLCertificateKeyFile   /etc/dehydrated/certs/<ホスト名>/privkey.pem

    # HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
    Header always set Strict-Transport-Security "max-age=63072000"
</VirtualHost>

# intermediate configuration
SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder     off

変更後、Webサービスを再起動する。

$ sudo systemctl restart httpd
$

WordPress導入

EPELレポジトリにWordPressパッケージがありますがバージョンが5.1.6と古く、また、WordPress管理画面からのアップデートとのバッティング問題がありますので、パッケージは使用しません。

/var/www/htmlにwordpressのtar.gzを展開します。

$ cd /var/www/html
$ sudo wget https://wordpress.org/latest.tar.gz
$ ls
latest.tar.gz
$ sudo tar xfz latest.tar.gz
$ ls
latest.tar.gz  wordpress
$ sudo rm latest.tar.gz
$ ls -l
total 4
drwxr-xr-x. 5 nobody nfsnobody 4096 Jun 11 06:48 wordpress
$

WordPressディレクトリの所有者をWebサービスのユーザである「apache」に変更します。

$ ps -ef|grep http
root     32093     1  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32094 32093  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32095 32093  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32096 32093  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32097 32093  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32098 32093  0 11:17 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32103 32093  0 11:18 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   32113 32093  0 11:19 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
opc      32700  1911  0 11:38 pts/0    00:00:00 grep --color=auto http
$ sudo chown -R apache:apache wordpress
$ ls -l
total 4
drwxr-xr-x. 5 apache apache 4096 Jun 11 06:48 wordpress
$

/var/www/html/wordpress をDocumentRootとするように ssl-mozilla.conf に追加する。

# generated 2020-07-07, Mozilla Guideline v5.4, Apache 2.4.6, OpenSSL 1.0.2k, intermediate configuration, no OCSP
# https://ssl-config.mozilla.org/#server=apache&version=2.4.6&config=intermediate&openssl=1.0.2k&ocsp=false&guideline=5.4

# this configuration requires mod_ssl, mod_rewrite, and mod_headers
<VirtualHost *:80>
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot /var/www/html/wordpress
    SSLEngine on
    SSLCertificateFile      /etc/dehydrated/certs/<ホスト名>/cert.pem
    SSLCertificateChainFile /etc/dehydrated/certs/<ホスト名>/chain.pem
    SSLCertificateKeyFile   /etc/dehydrated/certs/<ホスト名>/privkey.pem

    # HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
    Header always set Strict-Transport-Security "max-age=63072000"
</VirtualHost>

# intermediate configuration
SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder     off

設定後、Webサーバを再起動する

$ systemctl restart httpd
$

https://~/ にアクセスしてみると・・・

phpからmariadbにアクセスするためのパッケージが抜けていました。

$ sudo yum install php-mysql
<略>
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch       Version               Repository               Size
================================================================================
Installing:
 php-mysqlnd     x86_64     7.4.7-1.0.1.el7       ol7_developer_php74     228 k
Installing for dependencies:
 php-pdo         x86_64     7.4.7-1.0.1.el7       ol7_developer_php74     121 k

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 349 k
Installed size: 1.2 M
Is this ok [y/d/N]: y
<略>
$

php関連のパッケージを変更した場合は、httpdを再起動します。

$ sudo systemctl restart httpd
$

無事にWordpress初期画面が確認出来ました。

途中、wp-config.php に書き込めないと出ますので、「sudo vi /var/www/html/wordpress/wp-config.php」を実行し、指定された内容を記載します。

$ sudo vi /var/www/html/wordpress/wp-config.php

以上で完了です。