centos6 yum升级内核到4.4

post by rocdk890 / 2016-1-21 14:57 Thursday linux技术
  最近看到一篇文章Linux内核4.4版本带来的网络新特性,感觉还不错,想马上试试新内核,但又不想手动去编译内核,还好被我发现原来yum也可以升级内核到4.4了,马上行动.下面这篇文章是介绍怎么手动升级到内核4.4的,有兴趣的朋友可以看看,但不建议马上用到生产环境上.
 系统:centos 6.5(64位)
1.先查看内核
uname -r
2.6.32-431.el6.x86_64

2.查看系统版本
cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m

3.安装推荐的key和扩展源
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

RHEL-7, SL-7 or CentOS-7使用下面的:
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

RHEL-6, SL-6 or CentOS-6使用下面的:
rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

4.升级内核
yum --enablerepo=elrepo-kernel install kernel-ml kernel-ml-headers

5.修改/etc/grub.conf文件
vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (4.4.0-1.el6.elrepo.x86_64)
    root (hd0,0)
    kernel /vmlinuz-4.4.0-1.el6.elrepo.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
    initrd /initramfs-4.4.0-1.el6.elrepo.x86_64.img
#title CentOS (2.6.32-431.el6.x86_64)
#    root (hd0,0)
#    kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
#    initrd /initramfs-2.6.32-431.el6.x86_64.img


这里我禁掉了旧的内核,我这是实验环境不存在,但我建议还是改default吧,毕竟有问题的话,还可以切换回老的内核.

6.验证
重启服务器后,查看内核:
[root@slogra ~]# uname -a
Linux localhost.localdomain 4.4.0-1.el6.elrepo.x86_64 #1 SMP Sun Jan 10 23:12:35 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@slogra ~]# uname -r
4.4.0-1.el6.elrepo.x86_64
[root@slogra ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m

好了,内核升级就到这里.
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-627.html

标签: centos yum update kernel 内核