安装新内核的kernel,需要用到kernel-firmware的依赖关系。所以我们要把这两个RPM包都下载下来(感谢群友Devilkin℡给我提供这两个软件)。
kernel-2.6.32-202.el6.x86_64.rpm kernel-firmware-2.6.32-202.el6.noarch.rpm在安装kernel就必需先安装kernel-firmware,那么我们就先来安装他,看看会出现什么问题?
[root@yufei kernel]# rpm -ihv kernel-firmware-2.6.32-202.el6.noarch.rpm
warning: kernel-firmware-2.6.32-202.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f21541eb: NOKEY
Preparing... ########################################### [100%]
file /lib/firmware/isci/isci_firmware.bin from install of kernel-firmware-2.6.32-202.el6.noarch conflicts with file from package kernel-firmware-2.6.32-131.0.15.el6.noarch
file /usr/share/doc/kernel-firmware-2.6.32/WHENCE from install of kernel-firmware-2.6.32-202.el6.noarch conflicts with file from package kernel-firmware-2.6.32-131.0.15.el6.noarch提示也没有什么错误信息,只是说两个文件是存在的。但其实这个kernel-firmware是没有安装上的。
[root@yufei kernel]# rpm -ivh kernel-2.6.32-202.el6.x86_64.rpm
warning: kernel-2.6.32-202.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f21541eb: NOKEY
error: Failed dependencies:
kernel-firmware >= 2.6.32-202.el6 is needed by kernel-2.6.32-202.el6.x86_64这个原因在官方的BUG上面有提到,具体请到这里查看,主要的解决办法是用rpm -Uvh来代替rpm -ivh安装kernel-firmware。然后再安装kernel。
[root@yufei kernel]# rpm -Uvh kernel-firmware-2.6.32-202.el6.noarch.rpm
warning: kernel-firmware-2.6.32-202.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f21541eb: NOKEY
Preparing... ########################################### [100%]
1:kernel-firmware ########################################### [100%]
[root@yufei kernel]# 呵呵,已经没有什么提示了,我们来查一下,发现他也安装上了
kernel-firmware-2.6.32-202.el6.noarch
[root@yufei kernel]# 二、安装新内核kernel
[root@yufei kernel]# rpm -ivh kernel-2.6.32-202.el6.x86_64.rpm
warning: kernel-2.6.32-202.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f21541eb: NOKEY
Preparing... ########################################### [100%]
1:kernel ########################################### [100%]
[root@yufei kernel]# 注意:这里不要用rpm -Uvh。原因就是,用U参数,就直接把原内核升级了,而用i则是安装了新的内核,原内核依然是存在的。这样防止了新内核故障的产生。
[root@yufei kernel]# rpm -qa |grep kernel
kernel-firmware-2.6.32-202.el6.noarch
kernel-headers-2.6.32-131.0.15.el6.x86_64
kernel-2.6.32-131.0.15.el6.x86_64
kernel-devel-2.6.32-131.0.15.el6.x86_64
kernel-2.6.32-202.el6.x86_64
dracut-kernel-004-53.el6.noarch
[root@yufei kernel]# 呵呵,两个内核都在。
[root@yufei kernel]# cat /boot/grub/menu.lst
default=0
timeout=5
splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-202.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-202.el6.x86_64 ro root=UUID=d88d25c9-360e-42a8-b464-e16f93f8ef01 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-202.el6.x86_64.img
title Red Hat Enterprise Linux (2.6.32-131.0.15.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=UUID=d88d25c9-360e-42a8-b464-e16f93f8ef01 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=zh_CN.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-131.0.15.el6.x86_64.img发现多了新内核2.6.32-202.el6.x86_64。
[root@yufei kernel]# uname -r
2.6.32-131.0.15.el6.x86_64
[root@yufei kernel]# reboot
2.6.32-202.el6.x86_64
[root@yufei ~]# 新内核可以正常工作了。
[root@yufei ~]# ls /lib/modules/
2.6.32-131.0.15.el6.x86_64 2.6.32-202.el6.x86_64/boot/有2.6.32-202.el6.x86_64相关的文件
[root@yufei ~]# ls /boot/
config-2.6.32-131.0.15.el6.x86_64 symvers-2.6.32-202.el6.x86_64.gz
config-2.6.32-202.el6.x86_64 System.map
efi System.map-2.6.32-131.0.15.el6.x86_64
grub System.map-2.6.32-202.el6.x86_64
initramfs-2.6.32-131.0.15.el6.x86_64.img vmlinuz
initramfs-2.6.32-202.el6.x86_64.img vmlinuz-2.6.32-131.0.15.el6.x86_64
lost+found vmlinuz-2.6.32-202.el6.x86_64
symvers-2.6.32-131.0.15.el6.x86_64.gz
[root@yufei ~]# 至此,内核升级完成。自己慢慢享受吧!