Centos6.4系统内核升级

海外服务器 (371) 2015-10-28 15:54:40

1、查看现有系统的内核版本

 

[root@localhost ~]# uname -a

Linux localhost.localdomain 2.6.32-358.el6.i686 #1 SMP Thu Feb 21 21:50:49 UTC 2013 i686 i686 i386 GNU/Linux

[root@localhost ~]#

 

2、下载交解压新内核文件

 

[root@localhost home]# tar xvf linux-2.6.38.7.tar.gz

[root@localhost home]# cd linux-2.6.38.7

[root@localhost linux-2.6.38.7]#

 

3、升级内核的具体步骤

 

[root@localhost linux-2.6.38.7]# make mrproper   --清除环境变量,即清除配置文件

[root@localhost linux-2.6.38.7]# make menuconfig   --在菜单模式下选择需要编译的内核模块

networking support  —>  networking options  —>  network packet filtering framework(netfilter)

(1).core netfilter configuration

A 勾中”Netfilter connection tracking support”   -m state相关模块是依赖它的,不选则没有。

B 将netbios name service protocal support(new)    编译成模块,不然后面升级iptables后启动时会出错

C 勾中“Netfilter Xtables support (required for ip_tables)”

(2).IP: Netfilter Configuration

A 将 “IPv4 connection tracking support (require for NAT)” 编译成模块。

B 勾中IP tables support (required for filtering/masq/NAT) 。

C 将 “Full NAT” 下的 “MASQUERADE target support” 和 “REDIRECT target support” 编译成模块

[root@localhost linux-2.6.38.7]# make clean     --确保所有东西均保持最新状态.

[root@localhost linux-2.6.38.7]# make bzImage   --生成内核文件

[root@localhost linux-2.6.38.7]# make modules   --编译模块

[root@localhost linux-2.6.38.7]# make modules_install   --安装模块

[root@localhost linux-2.6.38.7]# make install      --安装

[root@localhost linux-2.6.38.7]# vim /etc/grub.conf

default=0             --将这一行改为0(选择启动时加载哪个内核)

[root@localhost linux-2.6.38.7]# reboot     --重启系统

 

4、验证内核是否成功

(1)系统启动时可以看到内核

 

centos6.4系统内核升级

 

(2)在系统中查看内核

 

centos6.4系统内核升级

THE END