CentOS6.X 升级内核 至 3.10

由于安装Docker时,Docker支持

  • CentOS 7 (64-bit)
  • CentOS 6.5 (64-bit) 或更高的版本

Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。 
Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本

CentOS 7 的内核一般都是3.10的,而CentOS 6.X 的内核一般都是2.6,在2.6的内核下,Docker运行会比较卡,所以一般会选择升级到3.10版本。

升级内核的方式,网上有很多方法是下载内核然后编译,这样需要安装很多必备的环境和工具,比较麻烦,但是也有助于我们了解内核的编译

编译内核方式升级: 
https://segmentfault.com/a/1190000000733628#articleHeader13

1. 查看当前内核版本

[root@localhost ~]# more /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

2. 导入public key

[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  • 1
  • 1

3. 安装ELRepo到CentOS

可以到http://elrepo.org/tiki/tiki-index.php 选择要安装的ELRepo:


[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
  • 1
  • 1

4. 安装 kernel-lt(lt=long-term)

[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y
  • 1
  • 1

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

[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y
  • 1
  • 1

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

[root@localhost ~]# vim /etc/grub.conf
  • 1
  • 1

这里写图片描述

因为一般新安装的内核在第一个位置,所以设置default=0,表示启动新内核

6. 重启

查看此时内核版本:

[root@localhost ~]# uname -r
3.10.105-1.el6.elrepo.x86_64
  • 1
  • 2
  • 1
  • 2

成功!

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/74935381