##记得切换到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

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

升级CentOS内核 - 2.6升级到3.10/最新内核的更多相关文章

  1. 升级CentOS内核 - 2.6升级到3.10

    *因为学习docker的需要,docker的官方推荐内核使用3.8以上,所以本人决定把CentOS内核升到长期稳定版的3.10. ##记得切换到root用户执行升级操作. [root@localhos ...

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

    网上有不少升级CentOS内核的文章,如<CentOS 6.5 升级内核到 3.10.28>,大部分都是下载源码编译,有点麻烦. 在yum的ELRepo源中,有mainline(3.13. ...

  3. 升级Centos 7/6内核版本到4.12.4的方法

    一.查看那系统内核版本 二.升级内核 三.修改grub中默认的内核版本 四.重启系统并查看系统内核 公司打算上Docker服务,目前需要安装运行环境,Docker新的功能除了需要Centos 7系统之 ...

  4. yum-cron更新 CentOS yum update 不升级内核版本方法

    http://www.360doc.com/content/15/0608/17/15798950_476597844.shtml 相关yum-cron说明有一些 CentOS yum update ...

  5. 升级CentOS 7.4内核版本的三种方案

    https://blog.csdn.net/breeze915/article/details/79243673 在实验环境下,已安装了最新的CentOS 7.4操作系统,现在需要升级内核版本. 实验 ...

  6. 升级CentOS 7.4内核版本--升级到最新

    在实验环境下,已安装了最新的CentOS 7.4操作系统,现在需要升级内核版本.实验环境 CentOS-7-x86_64-Minimal-1708.isoCentOS Linux release 7. ...

  7. Centos LInux 7.0 内核3.1 升级简化流程

    Centos LInux 7.0 内核3.1 升级建华流程 1)#导入ELRepo软件仓库的公共秘钥rpm --import https://www.elrepo.org/RPM-GPG-KEY-el ...

  8. Docker-01 无人值守升级 CentOS 6.x 系统内核到 3.10.x 长期支持版

    #!/bin/bash # # 无人值守升级 CentOS .x 系统内核到 3.10.x 长期支持版 # # # .检查操作系统是否为 CentOS .x # cat /etc/centos-rel ...

  9. CentOS 6.4中升级编译安装GCC 4.8.1 + GDB 7.6.1 + Eclipse 以及Kdump配置

    在CentOS 6.4中编译安装GCC 4.8.1 + GDB 7.6.1 + Eclipse 今天在isocpp上看到"GCC 4.8.1 released, C++11 feature ...

随机推荐

  1. GridView中数据行的操作

    一个是直接动态绑定gridview 用3楼的办法就可以了 int j=1;//j的数值表示你要取的那一列的索引,要取第二列,j就设为1for (int i = 0; i < this.GridV ...

  2. 如何在模板类中使用这些point类型?

    博客转载自:http://www.pclcn.org/study/shownews.php?lang=cn&id=271 由于PCL模块较多,并且是一个模板库,在一个源文件里包含很多PCL算法 ...

  3. VMware设置桥接网络

     VMware设置桥接网络 2011-12-30 08:57:04 分类: LINUX 一.桥接网络的基本原理    配置成桥接网络连接模式的虚拟机就当作主机所在以太网的一部分, 虚拟系统和宿主机器的 ...

  4. 32.Docker安装MongoDb

    从hub.docker.com上去找镜像 阿里云的国内的镜像地址 填上去之后,然后重启下docker就可以了 docker images列出本地的镜像 拉取mango的镜像 运行这个镜像 docker ...

  5. LIS与LCS的nlogn解法

    LIS(nlogn) #include<iostream> #include<cstdio> using namespace std; ; int a[maxn]; int n ...

  6. static_cast、dynamic_cast、const_cast和reinterpret_cast总结

    转自:http://www.jellythink.com/archives/205 前言 这篇文章总结的是C++中的类型转换,这些小的知识点,有的时候,自己不是很注意,但是在实际开发中确实经常使用的. ...

  7. HE学业水平考试游记 By cellur925

    \(I'm\) \(back\). Day -2 今天高二全体学生开始了愉悦的长达两天半的自习2333. 第一天刚了最不会的地理必修一.以前没发现,其实真的挺有趣的233. 于是用了一天学习了一年的地 ...

  8. java.sql.SQLException: Could not commit with auto-commit set on

    This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be u ...

  9. PHP命名大小写敏感规则

    一直觉得PHP中各种大小写规则理不清,就连工作多年的老手们也不一定能对PHP大小写敏感问题足够了解.在PHP中,大小写敏感问题的处理比较乱,大家一定要注意.即使某些地方大小写不敏感,但在编程过程中能始 ...

  10. [题解](双向bfs)hdu_3085_Nightmare Ⅱ

    发现直接搜索比较麻烦,但是要同时两个人一起走容易想到双向bfs,比较普通, 在判断是否碰到ghost时只要比较两点的曼哈顿距离大小和step*2(即ghost扩散的距离)即可,仔细思考也是可以想到的 ...