在 CentOS / RHEL / Fedora 等使用 yum(CentOS 7 及以前)或 dnf(CentOS 8+)的系统中,“升级 Linux 系统”通常有两种含义,下面分别说明。
这是最常见的“yum 升级系统”。
yum clean all
yum update
dnf clean all
dnf update
✅ 效果:
重启(如内核更新):
reboot
⚠️ yum 不支持直接跨大版本升级
需要:
leapp(CentOS 8 官方已停止维护)leapp + subscription-manager示例(RHEL):
leapp preupgrade
leapp upgrade
reboot
yum update kernel
或
dnf update kernel
yum list updates
yum update --exclude=kernel*
如果你能告诉我:
cat /etc/redhat-release)我可以给你精确命令。