How do I remove a kernel from Fedora for good?
5,490
It seems DNF does not give the full name of the package that would be needed by dnf remove
to remove the kernel.
For that it is better to use rpm
.
This is the command that worked for me:
sudo dnf remove $(rpm -qa | grep ^kernel | grep 5\.7)
Author by
ng.newbie
Updated on September 18, 2022Comments
-
ng.newbie over 1 year
I am running Fedora 32 and I want to remove the new 5.7 kernel since it is causing some problems.
I have tried:
sudo dnf remove kernel-*5.7.10-201.fc32.x86_64
And it did remove something but the kernel is still there in the GRUB menu and is strangely fully bootable.
How do I remove it for good ? I want it gone from the GRUB menu and completely from my system.
Running the command:
dnf list installed kernel-* | grep -i 5.7
proves the kernel 5.7 is still present:
kernel-core.x86_64 5.7.10-201.fc32 kernel-devel.x86_64 5.7.10-201.fc32 kernel-headers.x86_64 5.7.10-200.fc32 kernel-modules.x86_64 5.7.10-201.fc32 kernel-modules-extra.x86_64 5.7.10-201.fc32
How do I remove these and how do I get rid of it from GRUB ?
Note: Running something like:
sudo dnf remove kernel-core.x86_64 5.7.10-201.fc32 sudo dnf remove kernel-core.x86_64.5.7.10-201.fc32 sudo dnf remove kernel-core.5.7.10-201.fc32.x86_64
All give errors.
The errors are as follows:
$ sudo dnf remove kernel-core.x86_64 5.7.10-201.fc32 No match for argument: 5.7.10-201.fc32 Error: Problem: The operation would result in removing the following protected packages: kernel-core (try to add '--skip-broken' to skip uninstallable packages) $ sudo dnf remove kernel-core.x86_64.5.7.10-201.fc32 No match for argument: kernel-core.x86_64.5.7.10-201.fc32 No packages marked for removal. Dependencies resolved. Nothing to do. Complete! $ sudo dnf remove kernel-core.5.7.10-201.fc32.x86_64 No match for argument: kernel-core.5.7.10-201.fc32.x86_64 No packages marked for removal. Dependencies resolved. Nothing to do. Complete!
-
schaiba almost 4 yearsare you 100% sure that version is not the one currently running? what does
uname -r
say? -
ng.newbie almost 4 years@schaiba It says :
5.7.10-201.fc32.x86_64
-
ng.newbie almost 4 years@schaiba That is I can boot into the kernel after it has been removed. Which is to say is weird.
-
ng.newbie almost 4 years@rickhg12hs yes. I had to use rpm to get the full name.
-