本文介绍了centos8操作系统切换成Rocky Linux系统的过程。
1. 更新/升级当前的CentOS系统
进入到您的 CentOS,升级系统,以确保所有软件包准备就绪。
sudo dnf -y upgrade
升级完成后,重新启动系统以确保变更生效,包括与内核相关的变更。
sudo reboot
2. 获取migrate2rocky转换脚本
Rocky Linux 提供了一个名为migrate2rocky的工具,该工具已在许多RHEL变体版本(比如CentOS、Alma Linux和Oracle Linux)上成功地测试。migrate2rocky脚本可用于轻松地就地迁移到 Rocky Linux。
2.1 手动下载脚本
Download the compressed files from GitHub and extract the one you need (That'd be migrate2rocky.sh). You can find zip files for any GitHub repo on the right-ish side of the repo's main page:
Then, upload the executable to your server with ssh by running this command on your local machine:
scp PATH/TO/FILE/migrate2rocky.sh root@yourdomain.com:/home/
Just, you know, adjust all the file paths and server domains or IP addresses as needed.
2.2 使用git下载脚本
Install git on your server with:
dnf install git
Then clone the rocky-tools repository with:
git clone https://github.com/rocky-linux/rocky-tools.git
Note: this method will download all of the scripts and files in the rocky-tools repository.
2.3下载脚本。
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
2.4 使脚本可执行。
chmod +x migrate2rocky.sh
3. 开始从CentOS迁移到Rocky Linux的过程
最后,使用本地可用的脚本,用-r选项运行,以便从CentOS 8迁移到Rocky Linux 8。
sudo 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
该脚本会自动将CentOS 8 Linux代码存储库更改为Rocky Linux代码存储库。耐心等待,因为升级过程可能需要一些时间。
一旦迁移完成,您将看到:
Done, please reboot your system. A log of this installation can be found at /var/log/migrate2rocky.log
运行以下命令以同步已安装的软件包,然后只需重新启动系统。
sudo dnf distro-sync -y
sudo reboot
验证系统版本
参考链接