1. 从Centos Stream降到Centos8

1.1 download repo and release RPMs

wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.4-1.2105.el8.noarch.rpm
wget http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm

1.2 Remove stream repo and release RPMs and install the plain CentOS ones

sudo rpm -e --nodeps centos-stream-release centos-stream-repos
sudo rpm -ivh centos-linux-release-8.4-1.2105.el8.noarch.rpm centos-linux-repos-8-2.el8.noarch.rpm

1.3 Distrosync (i had to run with --allowerasing in order for it to run)

sudo yum distro-sync --allowerasing

1.4 Reboot

sudo reboot

2. 从Centos8转为Rocky Linux

可先通过hostnamectl命令确认信息再进行升级。

2.1a 脚本升级

wget https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
sudo ./migrate2rocky.sh -r

如果失败则建议手动安装。

2.1b 手动升级

rpm -e --nodeps centos-gpg-keys centos-linux-release centos-linux-repos

rpm -ivh \
  https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-release-8.3-13.el8.noarch.rpm \
  https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-repos-8.3-13.el8.noarch.rpm \
  https://download.rockylinux.org/pub/rocky/8.3/BaseOS/x86_64/os/Packages/rocky-gpg-keys-8.3-13.el8.noarch.rpm

dnf distro-sync -y

同样,重启后键入hostnamectl确认信息。

参考