当前位置: > CentOS > CentOS教程 > 系统配置 >

CentOS6.4升级内核3.4.56方法

时间:2014-11-04 09:54来源:linux.it.net.cn 作者:it
当前系统为CentOS Linux release 6.4 (Final),内核版本为2.6.32-358.el6.i686.将内核升级至3.4.56最新版本。

1、查看当前系统内核

# uname -r
2 2.6.32-358.el6.i686

2、下载linux-3.4.56内核包

# cd ~
# wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.56.tar.xz
# tar -Jxvf linux-3.4.56.tar.xz
# mv linux-3.4.56 /usr/src/linux-3.4.56
# cd linux-3.4.56

3、配置内核并安装

# make mrproper #清除环境变量,即清除配置文件
# make menuconfig #在菜单模式下选择需要编译的内核模块
# make clean #确保所有东西均保持最新状态.
# make bzImage #生成内核文件
# make modules #编译模块
# make modules_install #安装模块
# make install #安装

4、编辑 /etc/grub.conf 文件,将 default=1 改为 default=0

# 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,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1
timeout=3
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.4.56)
        root (hd0,0)
        kernel /vmlinuz-3.4.56 ro root=UUID=2c06f495-2f8c-4930-8968-9c612d32edc1 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
        initrd /initramfs-3.4.56.img
title CentOS (2.6.32-358.14.1.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.14.1.el6.i686 ro root=UUID=2c06f495-2f8c-4930-8968-9c612d32edc1 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-358.14.1.el6.i686.img
title CentOS (2.6.32-358.el6.i686)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.i686 ro root=UUID=2c06f495-2f8c-4930-8968-9c612d32edc1 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-358.el6.i686.img

5、重启系统,并查看内核

# reboot
# uname -r
3.4.56
(责任编辑:IT)
------分隔线----------------------------