Re: how to remove unwanted old kernels.

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

 



On Fri, Dec 1, 2023 at 5:42 PM home user <mattisonw@xxxxxxxxxxx> wrote:
>
> On 12/1/23 3:36 PM, Joe Zeff wrote:
> > On 12/01/2023 03:25 PM, home user wrote:
> >> The rpm command did not give me enough information, so I had to do the reboot.
> >
> > You could always look in /boot and see what's there.
> > --
> That was a part of that same post.  Here it is again:
> ------
> bash.1[~]: ls /boot
> config-6.5.10-200.fc38.x86_64
> config-6.5.12-200.fc38.x86_64
> config-6.5.8-200.fc38.x86_64
> config-6.6.2-101.fc38.x86_64
> efi
> grub2
> initramfs-0-rescue-70857e3fb05849139515e66a3fdc6b38.img
> initramfs-6.5.10-200.fc38.x86_64.img
> initramfs-6.5.12-200.fc38.x86_64.img
> initramfs-6.5.8-200.fc38.x86_64.img
> initramfs-6.6.2-101.fc38.x86_64.img
> loader
> lost+found
> memtest86+x64.bin
> symvers-6.5.10-200.fc38.x86_64.xz
> symvers-6.5.12-200.fc38.x86_64.xz
> symvers-6.5.8-200.fc38.x86_64.xz
> symvers-6.6.2-101.fc38.x86_64.xz
> System.map-6.5.10-200.fc38.x86_64
> System.map-6.5.12-200.fc38.x86_64
> System.map-6.5.8-200.fc38.x86_64
> System.map-6.6.2-101.fc38.x86_64
> vmlinuz-0-rescue-70857e3fb05849139515e66a3fdc6b38
> vmlinuz-6.5.10-200.fc38.x86_64
> vmlinuz-6.5.12-200.fc38.x86_64
> vmlinuz-6.5.8-200.fc38.x86_64
> vmlinuz-6.6.2-101.fc38.x86_64

You can manually remove the packages. You might try that next since
the dnf-system-upgrade script did not work for you.

For each kernel version you want to remove, specify them explicitly.
Here is what the names look like from an old F39 kernel on one of my
machines:

* kernel-6.5.11-300.fc39.x86_64
* kernel-core-6.5.11-300.fc39.x86_64
* kernel-modules-6.5.11-300.fc39.x86_64
* kernel-modules-core-6.5.11-300.fc39.x86_64
* kernel-modules-extra-6.5.11-300.fc39.x86_64

Now, if you encounter errors upon removal, then your RPM database
probably needs to be repaired.

And a sharp edge... The removal script has a bug, and it leaves
artifacts in /lib/modules. See
<https://bugzilla.redhat.com/show_bug.cgi?id=2185410>. For example,
even though I removed 6.5.11-300.fc39, it still has artifacts in
/lib/modules:

$ ls /lib/modules
6.5.11-300.fc39.x86_64    6.5.12-300.fc39.x86_64    6.6.2-201.fc39.x86_64

You can delete the leftover artifacts with this script:

clean_lib_modules() {
   if [[ -d "/lib/modules" ]]; then
       echo "Cleaning /lib/modules"
       mapfile -t dirs < <(ls /lib/modules)
       for dir in "${dirs[@]}"
       do
           dir="/lib/modules/${dir}"
           if [ "$(du -s -B 4096 "${dir}" | awk '{print $1}')" -lt 4096 ]
           then
               echo "  removing ${dir}"
               rm -rf "${dir}" 2>/dev/null
           fi
       done
   fi
}

Jeff
--
_______________________________________________
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