在 OpenVZ 服务器上更新内核时似乎出现错误
运行“yum update”时我得到下面的信息
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.steadfast.net
* extras: mirror.steadfast.net
* openvz-kernel-rhel6: download.openvz.org
* openvz-utils: download.openvz.org
* soluslabs: mirror.us1.soluslabs.net
* updates: mirror.steadfast.net
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.32-431.20.3.el6 will be installed
--> Processing Dependency: kernel-firmware >= 2.6.32-431.20.3.el6 for package: kernel- 2.6.32-431.20.3.el6.x86_64
Package kernel-firmware-2.6.32-431.20.3.el6.noarch is obsoleted by vzkernel-firmware- 2.6.32-042stab090.2.noarch which is already installed
---> Package kernel-headers.x86_64 0:2.6.32-431.17.1.el6 will be updated
---> Package kernel-headers.x86_64 0:2.6.32-431.20.3.el6 will be an update
---> Package libxml2.x86_64 0:2.7.6-14.el6_5.1 will be updated
---> Package libxml2.x86_64 0:2.7.6-14.el6_5.2 will be an update
---> Package tzdata.noarch 0:2014d-1.el6 will be updated
---> Package tzdata.noarch 0:2014e-1.el6 will be an update
---> Package vzkernel.x86_64 0:2.6.32-042stab090.4 will be installed
---> Package vzkernel-firmware.noarch 0:2.6.32-042stab090.2 will be updated
---> Package vzkernel-firmware.noarch 0:2.6.32-042stab090.4 will be an update
--> Finished Dependency Resolution
Error: Package: kernel-2.6.32-431.20.3.el6.x86_64 (updates)
Requires: kernel-firmware >= 2.6.32-431.20.3.el6
Removing: vzkernel-firmware-2.6.32-042stab090.2.noarch (@openvz-kernel-rhel6)
kernel-firmware = 2.6.32-431.17.1.el6
Updated By: vzkernel-firmware-2.6.32-042stab090.4.noarch (openvz-kernel-rhel6)
kernel-firmware = 2.6.32-431.17.1.el6
Available: kernel-firmware-2.6.32-431.el6.noarch (base)
kernel-firmware = 2.6.32-431.el6
Available: kernel-firmware-2.6.32-431.1.2.0.1.el6.noarch (updates)
kernel-firmware = 2.6.32-431.1.2.0.1.el6
Available: kernel-firmware-2.6.32-431.3.1.el6.noarch (updates)
kernel-firmware = 2.6.32-431.3.1.el6
Available: kernel-firmware-2.6.32-431.5.1.el6.noarch (updates)
kernel-firmware = 2.6.32-431.5.1.el6
Available: kernel-firmware-2.6.32-431.11.2.el6.noarch (updates)
kernel-firmware = 2.6.32-431.11.2.el6
Available: kernel-firmware-2.6.32-431.17.1.el6.noarch (updates)
kernel-firmware = 2.6.32-431.17.1.el6
Available: kernel-firmware-2.6.32-431.20.3.el6.noarch (updates)
kernel-firmware = 2.6.32-431.20.3.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
grub.conf 的内容
default=0
timeout=5
title OpenVZ (2.6.32-042stab090.2)
kernel /boot/vmlinuz-2.6.32-042stab090.2 root=/dev/sda2 ro crashkernel=auto SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
root (hd0,1)
initrd /boot/initramfs-2.6.32-042stab090.2.img
title OpenVZ (2.6.32-042stab088.4)
kernel /boot/vmlinuz-2.6.32-042stab088.4 root=/dev/sda2 ro crashkernel=auto SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=us
root (hd0,1)
initrd /boot/initramfs-2.6.32-042stab088.4.img
title linux centos6_64
kernel /boot/vmlinuz-2.6.32-431.17.1.el6.x86_64 root=/dev/sda2 ro
root (hd0,1)
initrd /boot/initrd-2.6.32-431.17.1.el6.x86_64.img
谢谢
答案1
您的系统中vzkernel-firmware
与 冲突kernel-firmware
。由于 vzkernel 软件包来自标准软件包存储库之外,因此此类冲突并不罕见。
假设您不使用原始 CentOS 内核,解决此问题的最简单方法是将其删除。为此,请运行:
yum remove kernel kernel-firmware
继续之前,请检查它不会删除您需要的任何包。
答案2
接受的答案是不正确,根据官方答案:
https://wiki.openvz.org/Vzkernel-firmware
正确答案:
您需要vzkernel-firmware
通过运行以下命令来删除:
rpm -e vzkernel-firmware
然后将以下内容添加到/etc/yum.repos.d/openvz.repo
:
exclude=vzkernel-firmware
答案3
我们在升级 OpenVZ 时多次预料到这个问题。我认为这个问题的最佳解决方案是:yum remove kernel
。它非常安全,并且永远解决了这个问题。我不知道为什么在 OpenVZ 节点上需要标准内核。
但是在删除内核包时请小心并多次检查“应该删除哪些包”。