“CentOS dropped”的含义
通常指CentOS系统因官方停止维护(如CentOS 7于2024年6月30日停止支持),无法再获得官方yum源的安全更新或新功能。此时需通过替代方案升级系统,以恢复安全支持或迁移至受维护的发行版。
/etc/目录)等至外部存储设备。cat /etc/centos-release
uname -m命令确认系统是x86_64(主流)还是i386(旧架构),避免下载错误的安装包。由于CentOS 7及更早版本已停止官方支持,优先选择升级到受维护的发行版,而非继续使用旧版CentOS:
CentOS Stream是CentOS的滚动更新版本,适合需要持续更新的用户:
sudo dnf install centos-stream-release
sudo dnf update -y
sudo reboot
cat /etc/centos-release # 应显示“CentOS Stream X”
Rocky Linux与CentOS高度兼容,适合追求稳定的企业用户:
sudo dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/rocky-release-9-20240429.0.el9.noarch.rpm
sudo dnf clean all
sudo dnf upgrade -y
sudo reboot
cat /etc/os-release # 应显示“Rocky Linux 9”
AlmaLinux与CentOS语法一致,适合习惯CentOS操作的用户:
sudo dnf install -y https://repo.almalinux.org/almalinux/9/BaseOS/x86_64/os/Packages/almalinux-release-9-20240506.0.el9.noarch.rpm
sudo dnf upgrade -y
sudo reboot
cat /etc/almalinux-release # 应显示“AlmaLinux 9”
若暂时无法迁移至新发行版,可通过ELRepo仓库升级内核,提升系统安全性(仅适用于CentOS 7):
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
sudo yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
kernel-ml为长期支持版):sudo yum --enablerepo=elrepo-kernel install kernel-ml -y
grub2-editenv list查看内核名称):sudo grub2-set-default 'CentOS Linux (新内核版本) 7 (Core)'
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo reboot
uname -r # 应显示新内核版本