如何升级Linux内核(RHEL/Fedora/CentOS升级内核 & Debian/Ubuntu升级内核)

转载来源:https://www.cyberciti.biz/faq/linux-kernel-upgrade-howto/

如何升级Linux内核

升级我的Linux内核?我想升级内核而不从源代码编译,即二进制升级。如何在Linux中执行内核的实际升级?

只有在以下情况下才需要编译内核: 

=>您需要为特定任务(如嵌入式内核)定制内核。

=>应用第三方安全补丁。

=>您需要将特定补丁应用于Linux

 

在Red Hat企业Linux版本<= 4.x中升级内核

如果您的系统已在Red Hat Network(RHN)中注册,则可以按如下方式使用up2date命令:
# up2date -f kernel


对于SMP内核(多核或多CPU),使用命令:
# up2date -f kernel-smp

 

在Fedora Linux / CentOS / RHEL 5中升级内核

使用yum命令升级内核:
# yum update kernel

 

如果您已下载RPM文件,请使用rpm命令
# rpm -ivh kernel*

 

在Debian或Ubuntu Linux中升级内核

使用apt-get命令。首先找到你的内核版本:
$ uname -r


接下来找到可用的内核映像:
$ apt-cache search linux-image


现在通过显式指定版本号来安装内核:
# apt-get install linux-image-x.x.x-xx
OR
$ sudo apt-get install linux-image-x.x.x-xx

 

PS:注意升级内核后,需要reboot才能通过 uname -a 查看到最新升级的内核版本,关于如何查看Unix&Unix-Like系统的内核版本,请参考下面文章:

如何查看CentOS版本https://mp.csdn.net/postedit/84832627

 

猜你喜欢

转载自blog.csdn.net/Aria_Miazzy/article/details/84842883