由于在安装docker的时候,docker需要的centos的系统版本是 内核 3.0以上版本的,一般我们使用的centos系统都是低版本内核的centos,这里说明一下怎样在centos当中升级系统的内核,非常简单。
网上也有其他的方法来升级内核,如下载内核之后编译安装,参看这篇文章
http://blog.csdn.net/u014057054/article/details/72461630
1.查看当前linux系统的内核
[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
2.导入public key
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
3.安装 ELRepo到centos
可以到这个网站 http://elrepo.org/tiki/tiki-index.php 下载需要的 ELRepo
将rpm下载到指定的文件夹之后,使用rpm -Uvh安装这个rp文件,首先到达路径下,比如下载到了 /usr/local这个目录下
[root@localhost ~]# cd /usr/local
[root@localhost ~]rpm -Uvh ./elrepo-release-6-6.el6.elrepo.noarch.rpm
4.安装kernel-lt (lt=long-term)
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y
或者安装 kernel-ml (ml=mainline)
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y
5.编辑grub.conf文件,修改grub引导顺序
[root@localhost ~]# vim /etc/grub.conf
因为一般新安装的内核在第一个位置,所以设置 default=0,表示启动新内核
6.重启并且重新查看目前的内核版本
[root@localhost ~]# sudo reboot
[root@localhost ~]# uname -r
3.10.105-1.el6.elrepo.x86_64