Home System Tutorial LINUX CentOS7/8 installs Linux kernel 5+ or above

CentOS7/8 installs Linux kernel 5+ or above

Feb 13, 2024 pm 03:21 PM
linux linux tutorial linux system linux command shell script embeddedlinux Getting started with linux linux learning

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
Copy after login

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

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/grub2/grub.cfg
Copy after login

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

grub2-set-default 0
reboot
Copy after login

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
Copy after login

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

grub2-editenv list
Copy after login

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

reboot
Copy after login

使用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
Copy after login

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
Copy after login

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

The above is the detailed content of CentOS7/8 installs Linux kernel 5+ or above. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

Android TV Box gets unofficial Ubuntu 24.04 upgrade Android TV Box gets unofficial Ubuntu 24.04 upgrade Sep 05, 2024 am 06:33 AM

Android TV Box gets unofficial Ubuntu 24.04 upgrade

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

BitPie Bitpie wallet app download address BitPie Bitpie wallet app download address Sep 10, 2024 pm 12:10 PM

BitPie Bitpie wallet app download address

BITGet official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

BITGet official website installation (2025 beginner's guide)

Zabbix 3.4 Source code compilation installation Zabbix 3.4 Source code compilation installation Sep 04, 2024 am 07:32 AM

Zabbix 3.4 Source code compilation installation

Detailed explanation: Shell script variable judgment parameter command Detailed explanation: Shell script variable judgment parameter command Sep 02, 2024 pm 03:25 PM

Detailed explanation: Shell script variable judgment parameter command

Ouyi okx installation package is directly included Ouyi okx installation package is directly included Feb 21, 2025 pm 08:00 PM

Ouyi okx installation package is directly included

See all articles