CentOS Linux 升级内核步骤和方法(转)
当前系统为CentOS Linux release 6.0 (Final),内核版本为2.6.32-71.el6.i686.由于最近内核出现最新的漏洞(linux kernel 又爆内存提权漏洞,2.6.39 内核无一幸免,所以将内核升级至3.2.2最新版本。
1、查看当前系统内核
# uname -r
2 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/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、重启系统,并查看内核
# reboot
# uname -r
3.2.
CentOS Linux 升级内核步骤和方法(转)的更多相关文章
- Linux 升级内核开启 TCP BBR 有多大好处
前言 如果你有订阅一些科技新闻,应该会有看过内核在4.9当中加入了一个新的算法,来解决在有一定的丢包率的情况下的带宽稳定的问题,这个是谷歌为我们带来的干货,新的 TCP 拥塞控制算法 BBR (Bot ...
- Linux安装mongoDB步骤和方法
Linux安装mongoDB步骤和方法 下载mongoDB数据库 mongodb-linux-x86_64-3.0.15.tgz 存放到linux文件夹中 ftp软件直接拖上去 解压文件夹(解压后,会 ...
- 关闭centos自动升级内核
八.关闭Centos自动更新chkconfig --list yum-updatesd #显示当前系统状态yum-updatesd 0:关闭 1:关闭 2:启用 3:启用 4:启用 ...
- Linux升级内核总结
Linux内核升级总结. 一.编译内核步骤 1.#uname –r 确定系统的原内核版本,然后下载较新版本的Linux内核源码包 http://www.kernel.org/pub/linux/ker ...
- CENTOS 7 升级内核版本(附带升级脚本)
写在前面的话 对于系统而言,除非是那种安全性要求非常高的公司或者经常会有第三方安全机构对其漏洞扫描的才容易涉及到系统的内核升级,比如之前呆过一个公司,因为需要做三级等保的原因,就会涉及到系统扫描,这时 ...
- CentOS 7 升级内核版本
1.查看当前内核版本 $ uname -r 3.10.0-514.el7.x86_64 $ uname -a Linux k8s-master 3.10.0-514.el7.x86_64 #1 SMP ...
- CentOS 7 升级内核
升级 CentOS 内核参考资料 1 升级 CentOS 内核参考资料 2 通过 /proc 虚拟文件系统读取或配置内核 Linux 内核官网 CentOS 官网 1. 关于 Linux 内核 Lin ...
- CentOS 6 - 升级内核
有的时候,需要升级Linux内核,今天我就是在CentOS 6中升级内核,在没有升级内核之前,我的CentOS 6只有2.6.32这一个内核,也是默认启动的内核.下面就开始一步步操作升级内核了! 一, ...
- Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法
问题: CentOS7安装完毕,重新开机启动后显示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License i ...
随机推荐
- echarts常用方法,legend状态支持两张图片切换(四)
在UI设计的时候,可能我们在使用echarts时,legend是用图片渲染的,未选中的legend是用置灰的图片展示的.即彩色图片,置灰图片交互切换. 主要代码如下: //图例事件 let lgdt ...
- 每日算法---Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...
- reactjs-swiper react轮播图组件基于swiper
react轮播图组件基于swiper demo地址:http://reactjs-ui.github.io/reactjs-swiper/simple.html 1. 下载安装 npm install ...
- 刷题upupup【Java中HashMap、HashSet用法总结】
HashMap: 常用操作 1. containsKey() 判断HashMap是否包含key 2. containsValue() 判断HashMap是否包含“值为value”的元素 3. get( ...
- linux下用户操作
在linux中添加ftp用,并设置相应的权限,操作步骤如下: 1.环境:ftp为vsftp.被限制用户名为test.被限制路径为/home/test. 2.建用户:在root用户下: useradd ...
- centos更换网易的源
刚安装的centos系统下载软件可能很慢,就可以试一下更换为国内比较知名的源试试.现在知道的网易和中科大源很不错.那么怎么更换呢 1. cd /etc/yum.repos.d/ c ...
- spring整合redis(哨兵模式)
首先服务器搭建哨兵模式(我这里使用的是Windows8系统),感谢两位博主,少走不少弯路,在此给出链接:服务器哨兵模式搭建和整合哨兵模式 什么一些介绍就不介绍了,可以看一下连接,比较详细,初次接触,当 ...
- js 取一定范围内的整数
function selectNum(lowNum,upNum) { var num = upNum-lowNum+1; // Math.floor() 向下取整 return Math.floor( ...
- Linux常用shell命令
1.>>>>>刚安装好的ubuntu需要为root创建密码[解决]passwd root 2.>>>>>安装完ubuntu后需要更新[解决] ...
- python pexpect包的一些用法
转自:https://www.jianshu.com/p/cfd163200d12 mark一下,原文中写的挺详细