Maison > Tutoriel système > Linux > le corps du texte

CentOS7/8 installe le noyau Linux 5+ ou supérieur

WBOY
Libérer: 2024-02-13 15:21:11
avant
1000 Les gens l'ont consulté

CentOS以稳定著称,稳定在另外一方面就是保守。所以CentOS7还在用3.10,CentOS8也才是4.18。而当前最新的Linux Kernel都更新到6.0 rc3了。其他较新的发行版都用上了5.10+的版本。本文简单介绍如何在CentOS7、8上直接安装5.1+以上版本的第三方内核。

CentOS7/8 安装 5+ 以上的Linux kernel

使用teddysun编译的5.15 Kernel包

ELRepo Project 提供的内核版本一直都比较稳定,但是这个库 kernel-ml 总是在新的大版本出来以后就不再提供旧的版本。比如 kernel-ml 分支 5.15 到 5.15.13 以后就不再更新了。5.15 是最新的 LTS 版本,秋水大神继续编译 5.15.x 的最新版本,直到 5.15.x 不再更新为止。

CentOS7

执行以下三个命令后reboot重启。

wget https://dl.lamp.sh/kernel/el7/kernel-ml-5.15.63-1.el7.x86_64.rpm \
https://dl.lamp.sh/kernel/el7/kernel-ml-devel-5.15.63-1.el7.x86_64.rpm \
https://dl.lamp.sh/kernel/el7/kernel-ml-headers-5.15.63-1.el7.x86_64.rpm \
https://dl.lamp.sh/kernel/el7/kernel-ml-tools-5.15.63-1.el7.x86_64.rpm \
https://dl.lamp.sh/kernel/el7/kernel-ml-tools-libs-5.15.63-1.el7.x86_64.rpm \
https://dl.lamp.sh/kernel/el7/kernel-ml-tools-libs-devel-5.15.63-1.el7.x86_64.rpm
yum localinstall kernel-ml-* -y --skip-broken
Copier après la connexion

成功安装后,执行以下命令查看本机已经存在的内核列表:

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/grub2/grub.cfg
Copier après la connexion

设置启动最新内核(一般最新安装的内核启动顺序为 0)

grub2-set-default 0
reboot
Copier après la connexion

CentOS8

wget https://dl.lamp.sh/kernel/el8/kernel-ml-5.15.63-1.el8.x86_64.rpm \
https://dl.lamp.sh/kernel/el8/kernel-ml-headers-5.15.63-1.el8.x86_64.rpm \
https://dl.lamp.sh/kernel/el8/kernel-ml-core-5.15.63-1.el8.x86_64.rpm \
https://dl.lamp.sh/kernel/el8/kernel-ml-devel-5.15.63-1.el8.x86_64.rpm \
https://dl.lamp.sh/kernel/el8/kernel-ml-modules-5.15.63-1.el8.x86_64.rpm \
https://dl.lamp.sh/kernel/el8/kernel-ml-modules-extra-5.15.63-1.el8.x86_64.rpm
 yum localinstall kernel-ml-* --allowerasing -y
Copier après la connexion

成功安装后,执行以下命令查看本机已经存在的内核启动顺序:

grub2-editenv list
Copier après la connexion

一般情况下返回的就是最新版的内核信息。CentOS Stream 8 / Rocky Linux 8 / AlmaLinux 8 无需手动设置启动最新内核。

reboot
Copier après la connexion

使用ELRepo更新最新稳定版内核

直接使用ELRepo Project 提供的内核,通过ELRepo安装最新稳定版的Linux Kerenl。当前是5.19.5。

CentOS7

yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm -y
yum --enablerepo=elrepo-kernel install kernel-ml -y &&
yum --enablerepo=elrepo-kernel install kernel-ml-devel -y 
grub2-set-default 0
reboot
Copier après la connexion

CentOS8

yum install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm -y
yum --enablerepo=elrepo-kernel install kernel-ml -y &&
yum --enablerepo=elrepo-kernel install kernel-ml-devel -y 
reboot
Copier après la connexion

令人惊喜的是CentOS 9 Stream x64已经用上了5.14的内核,所以不必赘述。

Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

source:lxlinux.net
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!