How to completely remove a recent kernel installaton?

Hello
Following a kernel upgrade from 8.9 to 8.10,
kernel-4.18.0-553.el8_10.x86_64
is offered as the latest kernel. Yet when I choose this kernel, the screen goes black and I have to crash the machine. I can restart on
kernel-4.18.0-513.24.1.el8_9.x86_64
without issue.
I used

sudo yum remove kernel-4.18.0-553.el8_10.x86_64

but it has not removed the kernel from the startup list.
Is there a way to completely remove kernel-4.18.0-553.el8_10.x86_64 and no longer have it was as an option on the startup list, so I can attempt a new upgrade?
Thank you

The package kernel does not contain any files. It simply requires the “real” kernel packages.

Run dnf rq --installonly
You should see some more kernel*-4.18.0-553.el8_10.x86_64 packages.

Run ls /boot/loader/entries/
The files you see, do define (some of) the entries that the startup list shows.

Removal of kernel packages should remove corresponding entry file too.

I get the below with some strange php error (that shows up every so often. not sure how to resolve it).

sudo dnf rq --installonly
[sudo] password for admin: 
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
kernel-0:4.18.0-513.18.1.el8_9.x86_64
kernel-0:4.18.0-513.24.1.el8_9.x86_64
kernel-0:4.18.0-553.el8_10.x86_64
kernel-core-0:4.18.0-513.18.1.el8_9.x86_64
kernel-core-0:4.18.0-513.24.1.el8_9.x86_64
kernel-core-0:4.18.0-553.el8_10.x86_64
kernel-devel-0:4.18.0-513.18.1.el8_9.x86_64
kernel-devel-0:4.18.0-513.24.1.el8_9.x86_64
kernel-devel-0:4.18.0-553.el8_10.x86_64
kernel-modules-0:4.18.0-513.18.1.el8_9.x86_64
kernel-modules-0:4.18.0-513.24.1.el8_9.x86_64
kernel-modules-0:4.18.0-553.el8_10.x86_64


sudo yum remove kernel-4.18.0-553.el8_10.x86_64
[sudo] password for admin: 
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
Dependencies resolved.
=====================================================================================================================================================
 Package                         Architecture                    Version                                      Repository                        Size
=====================================================================================================================================================
Removing:
 kernel                          x86_64                          4.18.0-553.el8_10                            @baseos                            0  

Transaction Summary
=====================================================================================================================================================
Remove  1 Package

Freed space: 0  
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                             1/1 
  Erasing          : kernel-4.18.0-553.el8_10.x86_64                                                                                             1/1 
  Running scriptlet: kernel-4.18.0-553.el8_10.x86_64                                                                                             1/1 
  Verifying        : kernel-4.18.0-553.el8_10.x86_64                                                                                             1/1 

Removed:
  kernel-4.18.0-553.el8_10.x86_64                                                                                                                    

Complete!
(base) [admin@LOWROCKY ~]$ sudo yum remove kernel-core-0:4.18.0-553.el8_10.x86_64
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
Dependencies resolved.
=====================================================================================================================================================
 Package                            Architecture               Version                                             Repository                   Size
=====================================================================================================================================================
Removing:
 kernel-core                        x86_64                     4.18.0-553.el8_10                                   @baseos                      71 M
Removing dependent packages:
 kernel-modules                     x86_64                     4.18.0-553.el8_10                                   @baseos                      25 M
 kmod-kvdo                          x86_64                     6.2.8.7-94.el8                                      @baseos                     1.8 M
 kmod-stex                          x86_64                     6.02.0000.01-3.el8_10.elrepo                        @elrepo                      67 k
 vdo                                x86_64                     6.2.9.7-14.el8                                      @baseos                     3.3 M

Transaction Summary
=====================================================================================================================================================
Remove  5 Packages

Freed space: 101 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                             1/1 
  Running scriptlet: kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64                                                                               1/1 
  Running scriptlet: kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64                                                                               1/5 
  Erasing          : kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64                                                                               1/5 
  Running scriptlet: kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64                                                                               1/5 
depmod: WARNING: /lib/modules/4.18.0-513.18.1.el8_9.x86_64/extra/uapfs.ko.xz needs unknown symbol ufsd_readahead_gfp_mask
depmod: ERROR: fstatat(4, nvidia-drm.ko.xz): No such file or directory
depmod: ERROR: fstatat(4, nvidia-modeset.ko.xz): No such file or directory
depmod: ERROR: fstatat(4, nvidia-peermem.ko.xz): No such file or directory
depmod: ERROR: fstatat(4, nvidia-uvm.ko.xz): No such file or directory
depmod: ERROR: fstatat(4, nvidia.ko.xz): No such file or directory
depmod: WARNING: /lib/modules/4.18.0-513.24.1.el8_9.x86_64/extra/uapfs.ko.xz needs unknown symbol ufsd_readahead_gfp_mask
depmod: WARNING: /lib/modules/4.18.0-553.el8_10.x86_64/kernel/external/uapfs/uapfs.ko needs unknown symbol ufsd_readahead_gfp_mask

  Running scriptlet: vdo-6.2.9.7-14.el8.x86_64                                                                                                   2/5 
  Erasing          : vdo-6.2.9.7-14.el8.x86_64                                                                                                   2/5 
  Running scriptlet: vdo-6.2.9.7-14.el8.x86_64                                                                                                   2/5 
  Running scriptlet: kmod-kvdo-6.2.8.7-94.el8.x86_64                                                                                             3/5 
  Erasing          : kmod-kvdo-6.2.8.7-94.el8.x86_64                                                                                             3/5 
  Running scriptlet: kmod-kvdo-6.2.8.7-94.el8.x86_64                                                                                             3/5 
depmod: WARNING: /lib/modules/4.18.0-553.el8_10.x86_64/kernel/external/uapfs/uapfs.ko needs unknown symbol ufsd_readahead_gfp_mask

  Erasing          : kernel-modules-4.18.0-553.el8_10.x86_64                                                                                     4/5 
  Running scriptlet: kernel-modules-4.18.0-553.el8_10.x86_64                                                                                     4/5 
  Running scriptlet: kernel-core-4.18.0-553.el8_10.x86_64                                                                                        5/5 
dkms: removing: nvidia 555.42.02 (4.18.0-553.el8_10.x86_64) (x86_64)
Module nvidia-555.42.02 for kernel 4.18.0-553.el8_10.x86_64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.
Removing any linked weak-modules
depmod: WARNING: /lib/modules/4.18.0-553.el8_10.x86_64/kernel/external/uapfs/uapfs.ko needs unknown symbol ufsd_readahead_gfp_mask

nvidia.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/4.18.0-553.el8_10.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-modeset.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/4.18.0-553.el8_10.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-drm.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/4.18.0-553.el8_10.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-uvm.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/4.18.0-553.el8_10.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

nvidia-peermem.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/4.18.0-553.el8_10.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...

  Erasing          : kernel-core-4.18.0-553.el8_10.x86_64                                                                                        5/5 
warning: file /lib/modules/4.18.0-553.el8_10.x86_64/updates: remove failed: No such file or directory

  Running scriptlet: kernel-core-4.18.0-553.el8_10.x86_64                                                                                        5/5 
  Verifying        : kernel-core-4.18.0-553.el8_10.x86_64                                                                                        1/5 
  Verifying        : kernel-modules-4.18.0-553.el8_10.x86_64                                                                                     2/5 
  Verifying        : kmod-kvdo-6.2.8.7-94.el8.x86_64                                                                                             3/5 
  Verifying        : kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64                                                                               4/5 
  Verifying        : vdo-6.2.9.7-14.el8.x86_64                                                                                                   5/5 

Removed:
  kernel-core-4.18.0-553.el8_10.x86_64                    kernel-modules-4.18.0-553.el8_10.x86_64           kmod-kvdo-6.2.8.7-94.el8.x86_64          
  kmod-stex-6.02.0000.01-3.el8_10.elrepo.x86_64           vdo-6.2.9.7-14.el8.x86_64                        

Complete!

sudo yum remove kernel-modules-0:4.18.0-553.el8_10.x86_64
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
No match for argument: kernel-modules-0:4.18.0-553.el8_10.x86_64
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!

sudo yum remove kernel-devel-0:4.18.0-553.el8_10.x86_64
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
Dependencies resolved.
=====================================================================================================================================================
 Package                              Architecture                   Version                                   Repository                       Size
=====================================================================================================================================================
Removing:
 kernel-devel                         x86_64                         4.18.0-553.el8_10                         @baseos                          53 M

Transaction Summary
=====================================================================================================================================================
Remove  1 Package

Freed space: 53 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                             1/1 
  Erasing          : kernel-devel-4.18.0-553.el8_10.x86_64                                                                                       1/1 
  Verifying        : kernel-devel-4.18.0-553.el8_10.x86_64                                                                                       1/1 

Removed:
  kernel-devel-4.18.0-553.el8_10.x86_64                                                                                                              

Complete!

sudo dnf rq --installonly
Modular dependency problem:

 Problem: conflicting requests
  - nothing provides module(httpd:2.4) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
  - nothing provides module(nginx) needed by module php:7.2:8040020210530192442:02bae935.x86_64 from @modulefailsafe
kernel-0:4.18.0-513.18.1.el8_9.x86_64
kernel-0:4.18.0-513.24.1.el8_9.x86_64
kernel-core-0:4.18.0-513.18.1.el8_9.x86_64
kernel-core-0:4.18.0-513.24.1.el8_9.x86_64
kernel-devel-0:4.18.0-513.18.1.el8_9.x86_64
kernel-devel-0:4.18.0-513.24.1.el8_9.x86_64
kernel-modules-0:4.18.0-513.18.1.el8_9.x86_64
kernel-modules-0:4.18.0-513.24.1.el8_9.x86_64

kernel-0:4.18.0-553.el8_10.x86_64 no longer shows up in the kernel start up list on restart and amazingly NVIDIA still works on the older kernels. Thank you very much for this solution.

You could try:

dnf module reset php

either that or the same for httpd and nginx as well. PHP 7.2 isn’t natively available on Rocky 9, only PHP 8.x.

1 Like

Well, your command line did the trick perfectly. I no longer have the error.
What a great morning for me. Thank you so much.

1 Like