centos7内核升级到3.18

安装kernel

https://linoxide.com/linux-how-to/upgrade-linux-kernel-stable-3-18-4-centos/

设置默认启动

https://blog.csdn.net/ykun089/article/details/106347681/

装最新的kernel

1. Downloading and Installing ELRepo

# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

2.Updating Kernel to version 3.18.4

yum --enablerepo=elrepo-kernel install kernel-ml

编译特定版本的kernel

1.Installing the Dependencies

yum install gcc ncurses ncurses-devel

yum update

2. Downloading the package

#  cd /tmp/
# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.4.tar.xz

3.Extracting the package

# tar -xf linux-3.18.4.tar.xz -C /usr/src/
# cd /usr/src/linux-3.18.4/

4. Configuring or use the old configuration directly

 make menuconfig

or

 make oldconfig

5.Compiling

 make

6. Installing into the system

make modules_install install

7.Verifying Kernel

uname -r

8. 设置默认启动该内核

a.查看当前默认启动内核

grub2-editenv list

b. 罗列所有内核

cat /boot/grub2/grub.cfg | grep menuentry

c. 设置默认启动内核

grub2-set-default 'CentOS Linux (3.10.107) 7 (Core)'

d.确认改动的结果

grub2-editenv list

e. 重启系统

reboot 

 9. tips

有的时候我们需要适用kernel内核的模块,比如powercap,然而并不是所有的kernel都有这个模块,比如3.10和3.13有,但是5.0没有。所以,当我们对模块有特定需求时,在升级kernel前要看一下kernel的源码,确认有我们想要的模块时,才能升级。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值