Remove Unused Kernel

Hi, there are topics already with this

But I have a bit specific question:

  1. I have
rpm -q kernel-core                                                                                                             

kernel-core-6.13.5-200.fc41.x86_64
kernel-core-6.13.6-200.fc41.x86_64
kernel-core-6.13.7-200.fc41.x86_64

uname -sr                                                                                                                                   
Linux 6.13.6-200.fc41.x86_64

6.13.7 is broken for me. I am on 6.13.6 now. I have updated grubby to point to 6.13.6.

How should I remove 6.13.7, so I can normally upgrade 6.13.6 to 7?

Should it be just done via?

  1. sudo dnf remove kernel-6.13.7-200.fc41.x86_64 ?
  2. sudo dnf remove kernel-core-6.13.7-200.fc41.x86_64 kernel-modules-6.13.7-200.fc41.x86_64 kernel-modules-extra-6.13.7-200.fc41.x86_64

Do I need to run sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg after?

Last answer in your linked topic:

No, there’s no need to remove them. People usually remove them if they are running short of space on the / partition. Fedora keeps 3 kernels installed by default, in case a new kernel has a regression and breaks some hardware users can reboot into an older kernel that works. (I test kernels from the updates-testing repository, so I sometimes even keep 5 kernels around)

If you just upgrade to a new kernel with the working kernel running, the not working “broken” kernels will be removed from Fedora as soon as there will be newer ones.

If you remove them now, on the next update dnf tries to install it again. If broken or not.

The better way to search for a solution is, to list your hardware, to see what could cause the issue.

Please be explicit – terms like “broken” do not get us closer to fixing the issue.

You should keep the “broken” kernel so you can collect details of your issue and post them here (as text, so can be found with internet searches). The majority of issues are not unique to Fedora, Linus’s law is the assertion that “given enough eyeballs, all bugs are shallow”. Providing hardware details (run inxi -Fzxx and past the output as pre-formatted text) will help get attention from others with similar hardware and issues.

The best way to remove all relevant packages would be to use
sudo dnf remove kernel*6.13.7*

It seems possible that the installation did not complete properly. A complete removal followed by sudo dnf upgrade would do a new installation and it may then boot properly.

2 Likes

This is what I was missing. Thank you!

Thanks, this also goes to bookmarks :blush:

Thank you!. The question was more about the process for how fix “broken” kernel. Basically, boot to working one and update. I have broken mine by playing around additional packages :slight_smile:

There should be details in journalctl. “Additional” packages may not work with newer kernels, but you should be able to identify the problematic package and decide whether to stick with older kernels until the package is updated or remove the package.

1 Like