How to remove old kernels in fedora

If you use fedora, with continuous update, you can see many kernels are available in grub. Over the time huge list of kernels become annoying. Removing these kernels are easy.

First, list the all available kernels using below command.

dnf list installed kernel

# Above command will produce output similar to this.

kernel.x86_64 6.12.9-200.fc41  updates
kernel.x86_64 6.12.10-200.fc41 updates
kernel.x86_64 6.12.11-200.fc41 updates

Then remove required kernel using,

sudo dnf remove <kernel-name>

e.g.
sudo dnf remove kernel.x86_64 6.12.9-200.fc41

Finally, update the grub and reboot the system.

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

That's it. Stay awesome !

links

social