For the relevant kernels running:

sudo apt purge linux-image-5.15.0-xx-generic linux-modules-5.15.0-xx-
generic linux-modules-extra-5.15.0-xx-generic

Or using this utility: https://git.launchpad.net/linux-purge

Then the leftover directories are correctly removed.

But I don't think you should have to rely on manual commands or 3rd
party utilities to clean out after old kernels.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2007286

Title:
  Ubuntu does not clean out old kernel module files (in /lib/modules)
  when old kernels are removed

Status in linux package in Ubuntu:
  Incomplete

Bug description:
  corrado@corrado-x-kinetic:~$ ls /lib/modules
  5.19.0-23-generic  5.19.0-28-generic  5.19.0-29-generic  5.19.0-31-generic
  corrado@corrado-x-kinetic:~$ ls /boot
  config-5.19.0-29-generic      memtest86+.elf
  config-5.19.0-31-generic      memtest86+_multiboot.bin
  efi                           System.map-5.19.0-29-generic
  grub                          System.map-5.19.0-31-generic
  initrd.img                    vmlinuz
  initrd.img-5.19.0-29-generic  vmlinuz-5.19.0-29-generic
  initrd.img-5.19.0-31-generic  vmlinuz-5.19.0-31-generic
  initrd.img.old                vmlinuz.old
  memtest86+.bin
  corrado@corrado-x-kinetic:~$ 
  see also 
https://discourse.ubuntu.com/t/ubuntu-does-not-clean-out-old-kernel-module-files-in-lib-modules-when-old-kernels-are-removed/33906

  ProblemType: Bug
  DistroRelease: Ubuntu 22.10
  Package: apt 2.5.3
  ProcVersionSignature: Ubuntu 5.19.0-31.32-generic 5.19.17
  Uname: Linux 5.19.0-31-generic x86_64
  ApportVersion: 2.23.1-0ubuntu3
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Feb 14 16:23:49 2023
  InstallationDate: Installed on 2022-11-28 (77 days ago)
  InstallationMedia: Ubuntu 22.10 "Kinetic Kudu" - Release amd64 (20221020)
  SourcePackage: apt
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2007286/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to