在 Linux 中,使用 yum(Yellowdog Updater, Modified)升级软件包主要适用于 CentOS 6/7、RHEL 6/7 等系统(CentOS 8 以后默认用 dnf)。
下面是常见的 yum 升级用法:
yum makecache
或
yum clean all
yum makecache
yum check-update
yum update
或
yum upgrade
区别说明:
yum update:升级包,但不删除旧包(更安全)yum upgrade:升级包,并可能删除不再需要的旧包
yum update nginx
yum update -y
或
yum upgrade -y
yum update kernel
升级后需重启:
reboot
yum update --exclude=kernel*
yum history
yum history undo <ID>
请改用:
dnf update
如果你能告诉我:
cat /etc/redhat-release)我可以给你更精准的建议。