View Full Version : dnf remove kernel-x.y.z not removed from grub2

15th November 2017, 02:29 AM
i would like to remove NEWer kernels from the grub2 menu. Ive had issues with kernels ahead of 4.12.

I removed the kernels using: `dnf remove kernel-<full name>` but this did not affect the grub2 cfg. i do not see extra kernels using `rpm -q kernel`

I tried reloading the grub2 cfg using: `grub2-mkconfig > /etc/grub2-efi.cfg` but its still seeing the previous configs :/

can i manually remove them from /boot? my concern is theyll be reloaded next time i have to make another grub2 cfg change.

thanks in advance!

15th November 2017, 06:36 AM
`kernel` is just a meta package, make sure that `kernel-core` and `kernel-modules` for the wanted kernel version are also being removed.

A small tip, you can add `exclude=kernel*4.12*` to `/etc/dnf/dnf.conf` to disable this particular kernel version from installing in the future.

15th November 2017, 08:56 AM
also check for and remove kernel-modules-extra

17th November 2017, 02:17 PM
dnf remove kernel-core-[VERSION]

will remove all kernel* pkgs with that version.

25th December 2017, 09:10 PM
sorry to necro but just wanted to say thanks for the explanation and suggestions.

`dnf remove kernel-core-4.13*` worked great. removed the core + extra modules.

i also added `exclude=kernel*` to dnf.conf, another great suggestion