當(dāng)前系統(tǒng)為CentOS Linux release 6.0 (Final),內(nèi)核版本為2.6.32-71.el6.i686.由于最近內(nèi)核出現(xiàn)最新的漏洞(linux kernel 又爆內(nèi)存提權(quán)漏洞,2.6.39 內(nèi)核無(wú)一幸免,所以將內(nèi)核升級(jí)至3.2.2最新版本。
1. 查看當(dāng)前系統(tǒng)內(nèi)核
# uname -r 2 2.6.32-71.el6.i686
2. 下載linux-3.2.2內(nèi)核包
# cd ~ # wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.2.tar.bz2 # tar jxvf linux-3.2.2.tar.bz2 # cd linux-3.2.2
3. 配置內(nèi)核并安裝
# make mrproper #清除環(huán)境變量,即清除配置文件 # make menuconfig #在菜單模式下選擇需要編譯的內(nèi)核模塊
找到以下選中選項(xiàng)并選中networking support → networking options → network packet filtering framework(netfilter)
(1).Core netfilter configuration
(2).IP: Netfilter Configuration
(3).其它模塊可以根據(jù)自己的需要進(jìn)行選擇,若不懂可以參考內(nèi)核配置手冊(cè).
# make clean #確保所有東西均保持最新?tīng)顟B(tài). # make bzImage #生成內(nèi)核文件 # 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=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS Linux (3.2.2) root (hd0,0) kernel /vmlinuz-3.2.2 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-3.2.2.img title centos (2.6.32-71.el6.i686) root (hd0,0) kernel /vmlinuz-2.6.32-71.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet initrd /initramfs-2.6.32-71.el6.i686.img
5. 重啟系統(tǒng),并查看內(nèi)核
# reboot # uname -r 3.2.2
聯(lián)系客服