CentOS Dropped迁移建议
CentOS的“Dropped”通常指其停止官方支持(如CentOS 7于2024年6月30日停止维护),此时继续使用存在安全风险,需迁移到其他长期支持(LTS)的Linux发行版。以下是具体迁移建议:
选择迁移目标时,需优先考虑长期支持、兼容性及业务需求:
无论选择哪种目标系统,迁移过程需遵循以下核心步骤:
rsync
、tar
或专业备份工具(如Veeam)备份所有重要数据(包括配置文件、数据库、网站文件),确保数据完整性;rsync
同步文件系统(如/etc
、/var
、/home
),手动迁移关键配置(如/etc/fstab
、/etc/ssh/sshd_config
、SELinux策略);/var/log/messages
、journalctl
)排查错误;yum update -y
);migrate2rocky
脚本(curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
),赋予执行权限(chmod +x migrate2rocky.sh
),运行脚本(sudo ./migrate2rocky.sh -r
);sudo reboot
),验证系统版本(cat /etc/redhat-release
)。anolis-migration.repo
(wget https://mirrors.openanolis.cn/anolis/migration/anolis-migration.repo -O /etc/yum.repos.d/anolis-migration.repo
),安装迁移工具(yum install -y centos2anolis
);centos2anolis.py
(默认迁移到ANCK内核,如需RHCK内核添加--rhck
参数),工具会自动扫描系统、下载必要软件包并完成升级;cat /etc/anolis-release
),确认服务正常运行。/etc/apt/sources.list
文件,替换为Ubuntu LTS的软件源(如deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
);rsync
同步/etc
、/var
等目录,手动调整Ubuntu特有的配置(如netplan
替代network-scripts
);apt
重新安装CentOS中的软件包(如sudo apt install apache2 mysql-server
),修复依赖问题(sudo apt --fix-broken install
)。chown
、chmod
),确保与源系统一致;