centos 內核升級

CentOS 7 的內核通常都是3.10的,而CentOS 6.X 的內核通常都是2.6,在2.6的內核下,Docker運行會比較卡,因此通常會選擇升級到3.10版本。php

升級內核的方式,網上有不少方法是下載內核而後編譯,這樣須要安裝不少必備的環境和工具,比較麻煩,可是也有助於咱們瞭解內核的編譯 
1. 查看當前內核版本java

[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. 導入public key
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  • 1

3.安裝ELRepo到CentOS 
能夠去http://elrepo.org/tiki/tiki-index.php 選擇要安裝的ELRepo 
這裏寫圖片描述
通常會安裝到最新版內核vim

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

4.安裝 kernel-lt(lt=long-term)ruby

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

或者 安裝kernel-ml(ml=mainline)dom

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

5.編輯grub.conf文件,修改Grub引導順序工具

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

這裏寫圖片描述 
由於通常新安裝的內核在第一個位置,因此設置default=0,表示啓動新內核 
6.重啓 
查看此時內核版本:spa

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

成功!code

相關文章
相關標籤/搜索