CentOS 6.0 升級核心步驟、方法

來源:互聯網
上載者:User

        當前系統為CentOS Linux release 6.0 (Final),核心版本為2.6.32-71.el6.i686.由於最近核心出現最新的漏洞(linux kernel 又爆記憶體提權漏洞,2.6.39 核心無一倖免,所以將核心升級至3.2.2最新版本。

1. 查看當前系統核心

# uname -r2 2.6.32-71.el6.i686

2. 下載linux-3.2.2核心包

# 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. 配置核心並安裝

# make mrproper  #清除環境變數,即清除設定檔# make menuconfig  #在菜單模式下選擇需要編譯的核心模

找到以下選中選項並選中networking support → networking options → network packet filtering framework(netfilter)

(1).core netfilter configuration

  • 勾中”Netfilter connection tracking support” -m state相關模組是依賴它的,不選則沒有。
  • 將netbios name service protocal support(new) 編譯成模組,不然後面升級iptables後啟動時會出錯
  • 勾中“Netfilter Xtables support (required for ip_tables)”

(2).IP: Netfilter Configuration

  • 將 “IPv4 connection tracking support (require for NAT)” 編譯成模組。
  • 勾中IP tables support (required for filtering/masq/NAT) 。
  • 將 “Full NAT” 下的 “MASQUERADE target support” 和 “REDIRECT target support” 編譯成模組

(3).其它模組可以根據自己的需要進行選擇,若不懂可以參考核心配置手冊.

# 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/sdadefault=1timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle 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 quietinitrd /initramfs-3.2.2.imgtitle 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 quietinitrd /initramfs-2.6.32-71.el6.i686.img

5. 重啟系統,並查看核心

# reboot # uname -r3.2.2

轉載地址:

http://www.linuxde.net/2012/02/7257.html

http://xugang.blog.51cto.com/400032/95621/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.