##记得切换到root用户执行升级操作.
[root@localhost ~]# uname -a ##旧版
Linux localhost.localdomain 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@localhost ~]# rpm -ivh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y ##此步会有点慢
[root@localhost ~]# vim /etc/grub.conf default=1 改为 default=0 ##设置默认以3.10核心启动,默认是按照旧的核心启动
[root@localhost ~]# reboot
[root@localhost ~]# uname -a ##升级后的版本
Linux localhost.localdomain 3.10.104-1.el6.elrepo.i686 #1 SMP Fri Oct 21 09:11:59 EDT 2016 i686 i686 i386 GNU/Linux

网上有很多操作案例都失效的。

上面方法适用于centos6,如果是centos7则rpm文件替换为https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

2、修改grub的主配置文件/etc/grub.conf,设置default=0,表示第一个title下的内容为默认启动的kernel(一般新安装的内核在第一个位置),修改之后如下:

[root@localhost ~]# cat /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,)
# kernel /vmlinuz-version ro root=/dev/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=
timeout=
splashimage=(hd0,)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.-.el6.x86_64)
root (hd0,)
kernel /vmlinuz-3.10.-.el6.x86_64 ro root=UUID=--472c-8ca4-110fb82e9959 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF- rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-3.10.-.el6.x86_64.img
title CentOS (2.6.-.el6.x86_64)
root (hd0,)
kernel /vmlinuz-2.6.-.el6.x86_64 ro root=UUID=--472c-8ca4-110fb82e9959 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF- rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
initrd /initramfs-2.6.-.el6.x86_64.img

3、重启系统,这时候你的内核就成功升级了,执行uname -r

内核升级wiki:http://elrepo.org/tiki/tiki-index.php

方法二:

cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo
yum install kernel-ml-aufs kernel-ml-aufs-devel -y

本方法没有测试过,有空再试试。

最新文章

  1. CentOS 6/7安装ffmpeg
  2. 【postman】postman
  3. xamarin(3.9.236)里DATETIMENOW的错误。
  4. IE6 的兼容相关问题
  5. 命令行下Git的使用
  6. Android 数据传递(一) Activity之间的数据传递
  7. JavaEE基础(九)
  8. 【JS】Beginner7:Functions
  9. Quartz定时任务学习(二)web应用
  10. Linux共享库两种加载方式简述
  11. JNI 可变印刷
  12. 一篇文章让你明白python的装饰器
  13. faster-rcnn系列笔记(一)
  14. shell 运算符章节笔记
  15. caffe 环境搭建
  16. HDU 1560 DNA sequence (迭代加深搜索)
  17. 《SSH网上商城》-视频目录--代码可以跑起来
  18. CSS预处理器之less
  19. discuz用户组
  20. 天使投资、A轮、B轮、C轮

热门文章

  1. iframe和window对象的关系
  2. sql中的begin....end
  3. JAVA学习笔记——(五)
  4. Ubuntu如何锁定分辨率
  5. HDU - 5950 Recursive sequence(二项式+矩阵合并+矩阵快速幂)
  6. nodebrew的安装与使用
  7. 自动化测试工具 Test Studio入门教程
  8. 关于c语言中的字符串问题
  9. 基于react+如何搭建一个完整的前端框架(1)
  10. 记录错误:tomcat“socket close”错误