如何从 CentOS 8 迁移到 Rocky Linux 8

如果您正在阅读这篇文章以将您的系统从 CentOS 8 迁移到 Rocky Linux 8,您可能知道 CentOS 公告,使 CentOS 成为 RHEL 的上游构建。 而以前,CentOS 是 Red Hat Enterprise Linux 的下游版本。

由于 CentOS 将在 2021 年底结束对 CentOS 8 的支持,因此只有少数几个选项摆在我们面前。

  1. 切换到 CentOS 8 流
  2. 迁移到 洛奇Linux 或其他兼容的发行版

洛奇Linux,由 CentOS 项目的创始人 Gregory Kurtzer 领导的 Rocky Linux 社区最受期待的 Linux 发行版。 它与 Red Hat Enterprise Linux 100% 二进制兼容。

Rocky Linux 社区已于 2021 年 6 月 21 日宣布 Rocky Linux 8.4 “Green Obsidian”全面上市,同时提供转换工具,支持从其他 EL 系统转换到 Rocky Linux 8.4。

按照以下步骤从 CentOS 8 迁移到 Rocky Linux 8.4 没有任何困难。 使用此程序的风险由您自己承担.

你也可以 下载 Rocky Linux 8 VirtualBox 或 VMware 映像 在计划迁移之前尝试一下。

更新 CentOS 8

将您的系统调至最新版本的 CentOS 8 (8.4.210)。

dnf update -y

重新启动系统以完成更新。

reboot

重启后检查操作系统版本。

cat /etc/centos-release

输出:

CentOS Linux release 8.4.210

从 CentOS 8 迁移到 Rocky Linux

从 Github 下载官方转换工具。

curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh

运行以下命令进行预检查。

bash migrate2rocky.sh -V

输出:

Creating a list of RPMs installed: begin Verifying RPMs installed against RPM database: begin  A log of this installation can be found at /var/log/migrate2rocky.log

如果预检没有错误,请继续将您的系统转换为 Rocky Linux 8。

bash migrate2rocky.sh -r

此转换需要一些时间才能完成,这取决于您的互联网连接速度。 等待更新完成。

输出:

Preparing to migrate CentOS Linux 8 to Rocky Linux 8.  Determining repository names for CentOS Linux 8.....  Found the following repositories which map from CentOS Linux 8 to Rocky Linux 8: CentOS Linux 8  Rocky Linux 8 appstream       appstream baseos          baseos extras          extras  Getting system package names for CentOS Linux 8.........  Found the following system packages which map from CentOS Linux 8 to Rocky Linux 8: CentOS Linux 8        Rocky Linux 8 centos-backgrounds    rocky-backgrounds centos-gpg-keys       rocky-gpg-keys centos-logos          rocky-logos  .    .    . .    .    .    xkeyboard-config-2.28-1.el8.noarch                                               yum-4.4.2-11.el8.noarch                                                          zlib-1.2.11-17.el8.x86_64                                                      Removed:   kernel-4.18.0-80.el8.x86_64              kernel-core-4.18.0-80.el8.x86_64        kernel-modules-4.18.0-80.el8.x86_64       Complete!   Done, please reboot your system. A log of this installation can be found at /var/log/migrate2rocky.log

迁移后重新启动系统。

reboot

重新启动后验证操作系统版本。

cat /etc/rocky-release

输出:

Rocky Linux release 8.4 (Green Obsidian

结论

就这样。 现在,您已成功将系统从 CentOS 8 迁移到 Rocky Linux 8。