这是 vCenter 上的虚拟机 (vmware)
当前内核3.10.0-862.el7.x86_64
[root@stage ~]# uname -a
Linux stage.dsr.FILTERED.net 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@stage ~]# hostnamectl
Static hostname: stage.dsr.FILTERED.net
Icon name: computer-vm
Chassis: vm
Machine ID: 4121FILTERED1663
Boot ID: b264FILTEREDa2dc
Virtualization: vmware
Operating System: CentOS Stream 8
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 3.10.0-862.el7.x86_64
Architecture: x86-64
安装最新内核
sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel kernel-ml-headers
[root@stage ~]# sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel kernel-ml-headers
Last metadata expiration check: 0:36:34 ago on Tue 21 Jun 2022 23:59:55 BST.
Package kernel-ml-5.18.5-1.el8.elrepo.x86_64 is already installed.
Package kernel-ml-devel-5.18.5-1.el8.elrepo.x86_64 is already installed.
Package kernel-ml-headers-5.18.5-1.el8.elrepo.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
检查可用的图像/boot
[root@stage boot]# ls -al
total 91212
dr-xr-xr-x. 6 root root 272 Jun 22 00:06 .
dr-xr-xr-x. 17 root root 224 Jun 22 00:01 ..
drwxr-xr-x. 3 root root 17 Aug 30 2018 efi
drwxr-xr-x. 2 root root 6 Jun 22 00:07 grub
drwx------. 5 root root 156 Jun 21 23:48 grub2
-rw-------. 1 root root 55388571 Aug 30 2018 initramfs-0-rescue-4121a368f8744621872224e7593f1663.img
-rw-------. 1 root root 12508372 Jun 7 18:44 initramfs-3.10.0-862.el7.x86_64kdump.img
-rw-------. 1 root root 19272908 Jun 22 00:06 initramfs-5.18.5-1.el8.elrepo.x86_64.img
drwxr-xr-x. 3 root root 21 Jun 21 23:48 loader
-rwxr-xr-x. 1 root root 6224704 Aug 30 2018 vmlinuz-0-rescue-4121a368f8744621872224e7593f1663
列出默认内核
[root@stage boot]# grubby --default-kernel
/boot/vmlinuz-0-rescue-4121a368f8744621872224e7593f1663
列出可用的
[root@stage boot]# ls -l /boot/vmlinuz-*
-rwxr-xr-x. 1 root root 6224704 Aug 30 2018 /boot/vmlinuz-0-rescue-4121a368f8744621872224e7593f1663
只有一个条目!
列出 RPM 内核包
[root@stage boot]# rpm -qa | grep kernel
kernel-ml-devel-5.18.5-1.el8.elrepo.x86_64
kernel-ml-headers-5.18.5-1.el8.elrepo.x86_64
kernel-ml-modules-5.18.5-1.el8.elrepo.x86_64
kernel-ml-5.18.5-1.el8.elrepo.x86_64
kernel-ml-core-5.18.5-1.el8.elrepo.x86_64
如何安装并设置5.18.5-1.el8.elrepo.x86_64
为新的默认内核?
任何指针都是最受欢迎的
更新 20220622
[root@stage ~]# dracut --force
dracut: Cannot find module directory /lib/modules/3.10.0-862.el7.x86_64/
dracut: and --no-kernel was not specified
也试过
dracut --kver 5.18.5-1.el8.elrepo.x86_64 --force
dracut --regenerate-all --force
vmlinuz-
但我的/boot
文件夹中仍然只有一个
[root@stage boot]# ls -al
drwxr-xr-x. 3 root root 17 Aug 30 2018 efi
drwxr-xr-x. 2 root root 6 Jun 22 00:07 grub
drwx------. 5 root root 156 Jun 22 16:44 grub2
-rw-------. 1 root root 55388571 Aug 30 2018 initramfs-0-rescue-4121a368f8744621872224e7593f1663.img
-rw-------. 1 root root 12508372 Jun 7 18:44 initramfs-3.10.0-862.el7.x86_64kdump.img
-rw-------. 1 root root 19457348 Jun 22 17:32 initramfs-5.18.5-1.el8.elrepo.x86_64.img
drwxr-xr-x. 3 root root 21 Jun 21 23:48 loader
-rwxr-xr-x. 1 root root 6224704 Aug 30 2018 vmlinuz-0-rescue-4121a368f8744621872224e7593f1663