使用工具 migrate2rocky
实现一键迁移(支持 CentOS 8/9 → Rocky Linux 8/9):
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
sudo ./migrate2rocky.sh -r
验证:检查 /etc/os-release
和软件包兼容性。