I have the below kernels installed on my machine:

[rajiviyer@rajiv-pc dnf]$ sudo dnf list installed kernel
Installed Packages
kernel.x86_64                     4.16.3-301.fc28                      @anaconda
kernel.x86_64                     4.18.14-200.fc28                     @updates 
[rajiviyer@rajiv-pc dnf]$ 

New Kernel: 4.18.14-200.fc28

Old Kernel: 4.16.3-301.fc28

Below is the list of dependencies for the Old Kernel: 4.16.3-301.fc28

[rajiviyer@rajiv-pc dnf]$ sudo dnf list installed kernel*4.16.3-301.fc28.x86_64
Installed Packages
kernel.x86_64                            4.16.3-301.fc28               @anaconda
kernel-core.x86_64                       4.16.3-301.fc28               @anaconda
kernel-modules.x86_64                    4.16.3-301.fc28               @anaconda
kernel-modules-extra.x86_64              4.16.3-301.fc28               @anaconda
[rajiviyer@rajiv-pc dnf]$ 

I got a reference article which shows the steps to remove old kernel: https://forums.fedoraforum.org/showthread.php?318051-How-to-delete-older-kernels-Fedora-28

Kindly advice if I should proceed with the steps laid down in the article.


Any GUI tool to remove kernel?

Post kernel removal what are post tasks need to be carried out? For e.g Updating GRUB

  • Fedora will remove old kernels automatically. But it keeps some around (3 by default) in case your newest kernel fails to boot. Do you really need to do this? – Michael Hampton Oct 20 '18 at 12:44
  • How can I switch to old kernel, if the new kernel fails to boot? – user315735 Oct 20 '18 at 13:28
  • You just choose it from the GRUB menu instead of waiting for it to boot. – Michael Hampton Oct 20 '18 at 14:26

Use the below command to remove the kernel - here -2 refers to the number of old kernels (including latest kernel).

dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy