Re: clean-up of old kernel fragments.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/7/24 4:15 PM, home user via users wrote:
On 11/6/24 10:15 PM, Jeffrey Walton wrote:
[snip]

`package-cleanup --oldkernels --count=2` might help with that. It
removes all old kernels except the current kernel and the one before
it.

-bash.6[~]: package-cleanup --oldkernels --count=2
package-cleanup has to be executed with one of the options: --dupes, -- leaves, --orphans, --problems or --cleandupes
-bash.7[~]:

I read the man page.  None of the options suggested above or in the man page seem to fit what's needed here.

You can also manually do it. For each old kernel listed in
/lib/modules, do something like this:

     export kernel_ver=6.11.5-200.fc40.x86_64
     dnf remove \
        kernel-$(kernel_ver) \
        kernel-core-$(kernel_ver) \
        kernel-devel-$(kernel_ver) \
        kernel-modules-$(kernel_ver)

I had to remove the parentheses.  The result of one case:

-bash.8[~]: export kernel_ver=6.10.12-100.fc39.x86_64
-bash.9[~]: echo $kernel_ver
6.10.12-100.fc39.x86_64
-bash.10[~]: dnf remove    kernel-$kernel_ver    kernel-core- $kernel_ver    kernel-devel-$kernel_ver    kernel-modules-$kernel_ver
No match for argument: kernel-6.10.12-100.fc39.x86_64
No match for argument: kernel-core-6.10.12-100.fc39.x86_64
No match for argument: kernel-devel-6.10.12-100.fc39.x86_64
No match for argument: kernel-modules-6.10.12-100.fc39.x86_64
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
-bash.11[~]:

I still have old kernel files in /boot:

-bash.17[~]: cd /boot
-bash.18[boot]: ls *-6.10.*
config-6.10.12-100.fc39.x86_64         System.map-6.10.12-100.fc39.x86_64
initramfs-6.10.12-100.fc39.x86_64.img  vmlinuz-6.10.12-100.fc39.x86_64
symvers-6.10.12-100.fc39.x86_64.xz

There are no packages involved. You just have to manually delete the files. You can verify by running "rpm -qf /boot/*" or whatever other directory you're checking to see which files aren't owned.

--
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux