yum 升级CentOS 6.5内核到 3.10

2016年7月15日

使用yum快速升级CentOS 6.5内核到 3.10.28

在yum的ELRepo源中,有mainline(3.13.1)、long-term(3.10.28)这2个内核版本,考虑到long-term更稳定,会长期更新,所以选择这个版本。

1、导入public key

  1. rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

2、安装ELRepo到CentOS-6.5中

  1. rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm

3、安装kernel-lt(lt=long-term) 长期支持版本 建议

  1. yum --enablerepo=elrepo-kernel install kernel-lt -y

或者安装kernel-ml(ml=mainline)

  1. yum --enablerepo=elrepo-kernel install kernel-ml -y

4、编辑grub.conf文件,修改Grub引导顺序

  1. vim /etc/grub.conf
  1. # grub.conf generated by anaconda
  2. #
  3. # Note that you do not have to rerun grub after making changes to this file
  4. # NOTICE: You do not have a /boot partition. This means that
  5. # all kernel and initrd paths are relative to /, eg.
  6. # root (hd0,0)
  7. # kernel /boot/vmlinuz-version ro root=/dev/sda1
  8. # initrd /boot/initrd-[generic-]version.img
  9. #boot=/dev/sda
  10. default=0
  11. timeout=5
  12. splashimage=(hd0,0)/boot/grub/splash.xpm.gz
  13. hiddenmenu
  14. title CentOS (3.10.28-1.el6.elrepo.x86_64)
  15. root (hd0,0)
  16. kernel /boot/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8
  17. rd_NO_LVM rd_NO_DM rhgb quiet
  18. initrd /boot/initramfs-3.10.28-1.el6.elrepo.x86_64.img
  19. title CentOS (2.6.32-431.3.1.el6.x86_64)
  20. root (hd0,0)
  21. kernel /boot/vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8 r
  22. d_NO_LVM rd_NO_DM rhgb quiet
  23. initrd /boot/initramfs-2.6.32-431.3.1.el6.x86_64.img
  24. title CentOS (2.6.32-431.el6.x86_64)
  25. root (hd0,0)
  26. kernel /boot/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO
  27. _LVM rd_NO_DM rhgb quiet
  28. initrd /boot/initramfs-2.6.32-431.el6.x86_64.img

确认刚安装好的内核在哪个位置,然后设置default值(从0开始),一般新安装的内核在第一个位置,所以设置default=0

5、重启,查看CentOS 6.5 内核版本号

  1. [root@dev ~]# uname -r
  2. 3.10.28-1.el6.elrepo.x86_64

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注