源码下载地址

https://mirrors.edge.kernel.org/pub/linux/kernel/

下载地址

http://vault.centos.org/

背景介绍(以7.7.1908版本为例)

This directory (and version of CentOS) is deprecated.  For normal users,
you should use /7/ and not /7.7.1908/ in your path. Please see this FAQ
concerning the CentOS release scheme:

https://wiki.centos.org/FAQ/General

If you know what you are doing, and absolutely want to remain at the 7.7.1908
level, go to http://vault.centos.org/ for packages. 

Please keep in mind that 7.7.1908 no longer gets any updates, nor
any security fix's.

具体下载地址:

http://vault.centos.org/7.7.1908/os/x86_64/Packages/

在当前页面寻找

kernel-3.10.0-1062.el7.x86_64.rpm

点击下载

默认按安装包名称字母排序,也可选择依据安装包大小进行排序,这样内核安装包可排在前。

下载指定内核安装包

wget -bc http://vault.centos.org/7.7.1908/os/x86_64/Packages/kernel-3.10.0-1062.el7.x86_64.rpm

查看默认启动顺序

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-c875ced17ca34874b991d1e118d8a217) 7 (Core)

安装下载的内核

yum install kernel-3.10.0-1062.el7.x86_64.rpm

查看默认启动顺序

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

设置默认启动顺序

grub2-set-default 0

或者另一种方法修改默认启动顺序:

vim /etc/default/grub

GRUB_TIMEOUT=2

GRUB_DISTRIBUTOR="$(sed 's, release.*$,,g' /etc/system-release)"

GRUB_DEFAULT=0              #<==save改为0

GRUB_DISABLE_SUBMENU=true

GRUB_TERMINAL_OUTPUT="console"

GRUB_CMDLINE_LINUX="crashkernel=autord.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"

GRUB_DISABLE_RECOVERY="true"

 

接下来运行下面的命令来重新创建内核配置。

grub2-mkconfig -o /boot/grub2/grub.cfg

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐