CentOS Linux 8 から CentOS Stream 8 への移行

1.dnf update -y

# dnf update -y
:
Complete!
# cat /etc/redhat-release
CentOS Linux release 8.5.2111
#

2.dnf install centos-release-stream
Errorメッセージがでる。
(try to add ‘–allowerasing’ to command line to replace conflicting packages or ‘–skip-broken’ to skip uninstallable packages or ‘–nobest’ to use not only best candidate packages)

# dnf install centos-release-stream
Last metadata expiration check: 0:12:44 ago on Fri 24 Dec 2021 12:01:26 PM JST.
Dependencies resolved.
================================================================================
 Package                   Arch       Version                  Repository  Size
================================================================================
Installing:
 centos-release-stream     x86_64     8.1-1.1911.0.7.el8       extras      11 k

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

Total download size: 11 k
Installed size: 6.6 k
Is this ok [y/N]: y
Downloading Packages:
centos-release-stream-8.1-1.1911.0.7.el8.x86_64 2.1 kB/s |  11 kB     00:05
--------------------------------------------------------------------------------
Total                                           1.0 kB/s |  11 kB     00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : centos-release-stream-8.1-1.1911.0.7.el8.x86_64        1/1
  Verifying        : centos-release-stream-8.1-1.1911.0.7.el8.x86_64        1/1
Installed products updated.

Installed:
  centos-release-stream-8.1-1.1911.0.7.el8.x86_64

Complete!
[root@localhost ~]# dnf distro-sync
CentOS-Stream - AppStream                       1.0 MB/s |  18 MB     00:17
CentOS-Stream - Base                            950 kB/s |  16 MB     00:16
CentOS-Stream - Extras                          1.0 kB/s |  16 kB     00:15
Last metadata expiration check: 0:00:01 ago on Fri 24 Dec 2021 12:15:58 PM JST.
Error:
 Problem 1: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-repos-8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.5-1.2111.el8.noarch
 Problem 2: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - problem with installed package centos-linux-repos-8-3.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch requires centos-gpg-keys = 1:8-2.el8, but none of the providers can be installed
  - cannot install both centos-gpg-keys-1:8-2.el8.noarch and centos-gpg-keys-1:8-3.el8.noarch
  - cannot install the best update candidate for package centos-release-stream-8.1-1.1911.0.7.el8.x86_64
  - cannot install the best update candidate for package centos-gpg-keys-1:8-3.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
# cat /etc/redhat-release
CentOS Linux release 8.5.2111
#

3.dnf distro-sync –allowerasing –nobest
orになっているが、 –allowerasing –nobestで再度distro-syncをやってみる。

# dnf distro-sync --allowerasing --nobest
:
Installed:
  centos-stream-release-8.5-2.el8.noarch  glibc-gconv-extra-2.28-174.el8.x86_64

Complete!
# cat /etc/redhat-release
CentOS Stream release 8
#

4.ちなみに、確認した環境では以下のパッケージが追加と廃止になっていた。
Installing : centos-stream-release-8.5-2.el8.noarch
Installing : glibc-gconv-extra-2.28-174.el8.x86_64

Obsoleting : centos-release-stream-8.1-1.1911.0.7.el8.x86_64
Obsoleting : centos-linux-release-8.5-1.2111.el8.noarch