I’m experiencing a seemingly unusual behavior with dnf autoremove on my Fedora 41 MATE system. As is common practice, I have three kernel versions installed (currently 6.13.8, 6.13.7, and 6.13.6). I recently ran the command sudo dnf upgrade --refresh && sudo dnf autoremove.
To my surprise, dnf autoremove proposed the removal of the kernel-devel packages for the two older kernels (6.13.6 and 6.13.7), while keeping only the kernel-devel for the newest kernel (6.13.8). This seems contrary to the usual Fedora behavior of maintaining kernel-devel packages corresponding to the installed kernels. I always review the packages before confirming removal and did not proceed with the autoremove.
I have verified that:
The kernel packages for all three versions (6.13.8, 6.13.7, 6.13.6) are indeed installed (rpm -qa | grep kernel-).
I have not made any manual changes to the keepinstall option in /etc/dnf/dnf.conf.
Is there a known reason why dnf autoremove might be proposing the removal of kernel-devel packages for older, still-installed kernels? I am also aware of the --exclude option for dnf autoremove.
Any insights or explanations would be greatly appreciated.
Did you install kernel-devel yourself, or indirectly as dependencies of say drivers (nvidia iirc needs it, few others)?
There’s an ‘installonly’ config option DNF Configuration Reference — DNF @DNF_VERSION@-1 documentation that prevents packages from ever being considered by autoremove.
That, in combination with setting the installonly count to three, is how I used to prevent kernel/drivers accidentally breaking during upgrades.
You can also use mark, (reportedly, not tried myself), to mark manually installed and not to be touched packages.
As for explanations, I can only base insights from docs, I assume it’s removing them because the kernel-devel-x packages have no dependencies, which can happen if the drivers built against them (or their packages) are using the latest kernel only.
Thank you very much for your interest and participation. I have a very old laptop and 2 USB Wi-Fi keys. I installed kernel-devel to try and get one of these working, the COMFAST CF-953AX with a Mediatek mt7921au chipset (unfortunately without success) in case my Intel 5300 PCI Wi-Fi is no longer detected, as has happened in the past.
I considered launching: