Announcement

Collapse
No announcement yet.

Just discovered over 20GB of old kernels which weren't being autoremoved.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Just discovered over 20GB of old kernels which weren't being autoremoved.

    For awhile I've been dealing with low disk space issues on my Kubuntu partition. I've moved personal files to other partitions; I've removed other less-used packages (LibreOffice) just to make space; I've run bleachbit almost every other day recently. Finally today I looked further into what could possibly be causing Kubuntu 22.04.03 to require almost 50GB of space.

    It turns out autoremove hasn't been removing old kernels. As a result I had about 24GB of them.

    This is a long-known issue, referenced here over 2 years ago:

    https://askubuntu.com/questions/1325...my-old-kernels

    How is this not considered a bug?

    #2
    Probably it has been reported on Ubuntu's Launchapd, possibly more than once. However, it doesn't seem to be consistent, not doing this to everyone. This makes it hard to diagnose.
    We don't know exactly what you removed, so it is hard to add context in your case. Were they old, or did you get hit with a recent Nvidia package bug that cause a few to have a number of non-standard kernels inadvertently installed?

    Personally, the only time I have ever seen a pileup was that one time I upgrade Kubuntu 7 releases in a row

    Three are supposed to be kept. A few more, if an LTS user started with the original 5.15 "GA" kernel, then moved to the HWE track (which adds newer kernels, not replacing 5.15). Most people are automatically on the HWE track, which starts with the 22.04.2 ISO image.

    Comment


      #3
      Originally posted by claydoh View Post
      Probably it has been reported on Ubuntu's Launchapd, possibly more than once. However, it doesn't seem to be consistent, not doing this to everyone. This makes it hard to diagnose.
      We don't know exactly what you removed, so it is hard to add context in your case. Were they old, or did you get hit with a recent Nvidia package bug that cause a few to have a number of non-standard kernels inadvertently installed?

      Personally, the only time I have ever seen a pileup was that one time I upgrade Kubuntu 7 releases in a row

      Three are supposed to be kept. A few more, if an LTS user started with the original 5.15 "GA" kernel, then moved to the HWE track (which adds newer kernels, not replacing 5.15). Most people are automatically on the HWE track, which starts with the 22.04.2 ISO image.
      I removed all 5.4 kernels as I'm running 5.15. I still had a copy of the list of what I removed using sudo apt purge, so here it is:
      Code:
      linux-headers-5.4.0-100
      linux-headers-5.4.0-100-generic
      linux-headers-5.4.0-109
      linux-headers-5.4.0-109-generic
      linux-headers-5.4.0-110
      linux-headers-5.4.0-110-generic
      linux-headers-5.4.0-113
      linux-headers-5.4.0-113-generic
      linux-headers-5.4.0-117
      linux-headers-5.4.0-117-generic
      linux-headers-5.4.0-120
      linux-headers-5.4.0-120-generic
      linux-headers-5.4.0-121
      linux-headers-5.4.0-121-generic
      linux-headers-5.4.0-122
      linux-headers-5.4.0-122-generic
      linux-headers-5.4.0-124
      linux-headers-5.4.0-124-generic
      linux-headers-5.4.0-126
      linux-headers-5.4.0-126-generic
      linux-headers-5.4.0-132
      linux-headers-5.4.0-132-generic
      linux-headers-5.4.0-135
      linux-headers-5.4.0-135-generic
      linux-headers-5.4.0-136
      linux-headers-5.4.0-136-generic
      linux-headers-5.4.0-139
      linux-headers-5.4.0-139-generic
      linux-headers-5.4.0-146
      linux-headers-5.4.0-146-generic
      linux-headers-5.4.0-147
      linux-headers-5.4.0-147-generic
      linux-headers-5.4.0-28
      linux-headers-5.4.0-28-generic
      linux-headers-5.4.0-29
      linux-headers-5.4.0-29-generic
      linux-headers-5.4.0-31
      linux-headers-5.4.0-31-generic
      linux-headers-5.4.0-37
      linux-headers-5.4.0-37-generic
      linux-headers-5.4.0-40
      linux-headers-5.4.0-40-generic
      linux-headers-5.4.0-42
      linux-headers-5.4.0-42-generic
      linux-headers-5.4.0-47
      linux-headers-5.4.0-47-generic
      linux-headers-5.4.0-51
      linux-headers-5.4.0-51-generic
      linux-headers-5.4.0-52
      linux-headers-5.4.0-52-generic
      linux-headers-5.4.0-53
      linux-headers-5.4.0-53-generic
      linux-headers-5.4.0-54
      linux-headers-5.4.0-54-generic
      linux-headers-5.4.0-58
      linux-headers-5.4.0-58-generic
      linux-headers-5.4.0-60
      linux-headers-5.4.0-60-generic
      linux-headers-5.4.0-62
      linux-headers-5.4.0-62-generic
      linux-headers-5.4.0-64
      linux-headers-5.4.0-64-generic
      linux-headers-5.4.0-71
      linux-headers-5.4.0-71-generic
      linux-headers-5.4.0-72
      linux-headers-5.4.0-72-generic
      linux-headers-5.4.0-73
      linux-headers-5.4.0-73-generic
      linux-headers-5.4.0-74
      linux-headers-5.4.0-74-generic
      linux-headers-5.4.0-77
      linux-headers-5.4.0-77-generic
      linux-headers-5.4.0-80
      linux-headers-5.4.0-80-generic
      linux-headers-5.4.0-81
      linux-headers-5.4.0-81-generic
      linux-headers-5.4.0-84
      linux-headers-5.4.0-84-generic
      linux-headers-5.4.0-86
      linux-headers-5.4.0-86-generic
      linux-headers-5.4.0-89
      linux-headers-5.4.0-89-generic
      linux-headers-5.4.0-90
      linux-headers-5.4.0-90-generic
      linux-headers-5.4.0-91
      linux-headers-5.4.0-91-generic
      linux-headers-5.4.0-92
      linux-headers-5.4.0-92-generic
      linux-headers-5.4.0-94
      linux-headers-5.4.0-94-generic
      linux-headers-5.4.0-96
      linux-headers-5.4.0-96-generic
      linux-headers-5.4.0-97
      linux-headers-5.4.0-97-generic
      linux-headers-5.4.0-99
      linux-headers-5.4.0-99-generic
      linux-image-5.4.0-100-generic
      linux-image-5.4.0-109-generic
      linux-image-5.4.0-110-generic
      linux-image-5.4.0-113-generic
      linux-image-5.4.0-117-generic
      linux-image-5.4.0-120-generic
      linux-image-5.4.0-121-generic
      linux-image-5.4.0-122-generic
      linux-image-5.4.0-124-generic
      linux-image-5.4.0-126-generic
      linux-image-5.4.0-132-generic
      linux-image-5.4.0-135-generic
      linux-image-5.4.0-136-generic
      linux-image-5.4.0-139-generic
      linux-image-5.4.0-146-generic
      linux-image-5.4.0-147-generic
      linux-image-5.4.0-28-generic
      linux-image-5.4.0-29-generic
      linux-image-5.4.0-31-generic
      linux-image-5.4.0-37-generic
      linux-image-5.4.0-40-generic
      linux-image-5.4.0-42-generic
      linux-image-5.4.0-47-generic
      linux-image-5.4.0-51-generic
      linux-image-5.4.0-52-generic
      linux-image-5.4.0-53-generic
      linux-image-5.4.0-54-generic
      linux-image-5.4.0-58-generic
      linux-image-5.4.0-60-generic
      linux-image-5.4.0-62-generic
      linux-image-5.4.0-64-generic
      linux-image-5.4.0-71-generic
      linux-image-5.4.0-72-generic
      linux-image-5.4.0-73-generic
      linux-image-5.4.0-74-generic
      linux-image-5.4.0-77-generic
      linux-image-5.4.0-80-generic
      linux-image-5.4.0-81-generic
      linux-image-5.4.0-84-generic
      linux-image-5.4.0-86-generic
      linux-image-5.4.0-89-generic
      linux-image-5.4.0-90-generic
      linux-image-5.4.0-91-generic
      linux-image-5.4.0-92-generic
      linux-image-5.4.0-94-generic
      linux-image-5.4.0-96-generic
      linux-image-5.4.0-97-generic
      linux-image-5.4.0-99-generic
      linux-modules-5.4.0-100-generic
      linux-modules-5.4.0-109-generic
      linux-modules-5.4.0-110-generic
      linux-modules-5.4.0-113-generic
      linux-modules-5.4.0-117-generic
      linux-modules-5.4.0-120-generic
      linux-modules-5.4.0-121-generic
      linux-modules-5.4.0-122-generic
      linux-modules-5.4.0-124-generic
      linux-modules-5.4.0-126-generic
      linux-modules-5.4.0-132-generic
      linux-modules-5.4.0-135-generic
      linux-modules-5.4.0-136-generic
      linux-modules-5.4.0-139-generic
      linux-modules-5.4.0-146-generic
      linux-modules-5.4.0-147-generic
      linux-modules-5.4.0-28-generic
      linux-modules-5.4.0-29-generic
      linux-modules-5.4.0-31-generic
      linux-modules-5.4.0-37-generic
      linux-modules-5.4.0-40-generic
      linux-modules-5.4.0-42-generic
      linux-modules-5.4.0-47-generic
      linux-modules-5.4.0-51-generic
      linux-modules-5.4.0-52-generic
      linux-modules-5.4.0-53-generic
      linux-modules-5.4.0-54-generic
      linux-modules-5.4.0-58-generic
      linux-modules-5.4.0-60-generic
      linux-modules-5.4.0-62-generic
      linux-modules-5.4.0-64-generic
      linux-modules-5.4.0-71-generic
      linux-modules-5.4.0-72-generic
      linux-modules-5.4.0-73-generic
      linux-modules-5.4.0-74-generic
      linux-modules-5.4.0-77-generic
      linux-modules-5.4.0-80-generic
      linux-modules-5.4.0-81-generic
      linux-modules-5.4.0-84-generic
      linux-modules-5.4.0-86-generic
      linux-modules-5.4.0-89-generic
      linux-modules-5.4.0-90-generic
      linux-modules-5.4.0-91-generic
      linux-modules-5.4.0-92-generic
      linux-modules-5.4.0-94-generic
      linux-modules-5.4.0-96-generic
      linux-modules-5.4.0-97-generic
      linux-modules-5.4.0-99-generic
      linux-modules-extra-5.4.0-100-generic
      linux-modules-extra-5.4.0-109-generic
      linux-modules-extra-5.4.0-110-generic
      linux-modules-extra-5.4.0-113-generic
      linux-modules-extra-5.4.0-117-generic
      linux-modules-extra-5.4.0-120-generic
      linux-modules-extra-5.4.0-121-generic
      linux-modules-extra-5.4.0-122-generic
      linux-modules-extra-5.4.0-124-generic
      linux-modules-extra-5.4.0-126-generic
      linux-modules-extra-5.4.0-132-generic
      linux-modules-extra-5.4.0-135-generic
      linux-modules-extra-5.4.0-136-generic
      linux-modules-extra-5.4.0-139-generic
      linux-modules-extra-5.4.0-146-generic
      linux-modules-extra-5.4.0-147-generic
      linux-modules-extra-5.4.0-28-generic
      linux-modules-extra-5.4.0-29-generic
      linux-modules-extra-5.4.0-31-generic
      linux-modules-extra-5.4.0-37-generic
      linux-modules-extra-5.4.0-40-generic
      linux-modules-extra-5.4.0-42-generic
      linux-modules-extra-5.4.0-47-generic
      linux-modules-extra-5.4.0-51-generic
      linux-modules-extra-5.4.0-52-generic
      linux-modules-extra-5.4.0-53-generic
      linux-modules-extra-5.4.0-54-generic
      linux-modules-extra-5.4.0-58-generic
      linux-modules-extra-5.4.0-60-generic
      linux-modules-extra-5.4.0-62-generic
      linux-modules-extra-5.4.0-64-generic
      linux-modules-extra-5.4.0-71-generic
      linux-modules-extra-5.4.0-72-generic
      linux-modules-extra-5.4.0-73-generic
      linux-modules-extra-5.4.0-74-generic
      linux-modules-extra-5.4.0-77-generic
      linux-modules-extra-5.4.0-80-generic
      linux-modules-extra-5.4.0-81-generic
      linux-modules-extra-5.4.0-84-generic
      linux-modules-extra-5.4.0-86-generic
      linux-modules-extra-5.4.0-89-generic
      linux-modules-extra-5.4.0-90-generic
      linux-modules-extra-5.4.0-91-generic
      linux-modules-extra-5.4.0-92-generic
      linux-modules-extra-5.4.0-94-generic
      linux-modules-extra-5.4.0-96-generic
      linux-modules-extra-5.4.0-97-generic
      linux-modules-extra-5.4.0-99-generic
      ​
      Last edited by oshunluvr; Aug 07, 2023, 07:40 AM.

      Comment


      • oshunluvr
        oshunluvr commented
        Editing a comment
        Hey, do all of us a favor and when you have more than 10 lines or so of output, enclose it in CODE tags as I did here or QUOTE tags so the post itself doesn't become so huge that it requires several scrolls to get to the next post. Thanks!

      #4
      So, you upgraded from 20.04, I take it? I would say it was a bug in 20.04, as opposed to 22.04, since all of these came from Focal. At worst, you should only have had the last three 5.4 kernels available at the time you upgraded, and then eventually three of 5.15 after the upgrade

      But a bug in the PackageKit version in Focal looks to be the culprit. Discover isn't the only tool that uses this.
      It doesn't look like they were able to back-port the fix from the later version of the version in 20.04.

      There is also this nugget from the memory hole.
      Last edited by claydoh; Aug 07, 2023, 08:00 AM.

      Comment


        #5
        IME, when one switches to a different kernel series, the old one is or can be ignored, thus not removed.

        Please Read Me

        Comment


          #6
          Originally posted by claydoh View Post
          So, you upgraded from 20.04, I take it? I would say it was a bug in 20.04, as opposed to 22.04, since all of these came from Focal. At worst, you should only have had the last three 5.4 kernels available at the time you upgraded, and then eventually three of 5.15 after the upgrade

          But a bug in the PackageKit version in Focal looks to be the culprit. Discover isn't the only tool that uses this.
          It doesn't look like they were able to back-port the fix from the later version of the version in 20.04.

          There is also this nugget from the memory hole.
          Yep, upgraded from 20.04. So even a fresh install of 22.04 has this same problem?

          My impression from the thread I linked is this will continue happening if I do kernel upgrades in Discover, so from now on I'll just unmark kernel upgrades in Discover and then do them on the command line.

          Comment


            #7
            Originally posted by djphilosophy View Post
            Yep, upgraded from 20.04. So even a fresh install of 22.04 has this same problem?
            No, or at least it is not at all common. The particular bug I linked to was fixed for Packagekit in 22.04, they could not fix it in the version of that software in 20.04. Note that none of the kernels in your list is from 22.04.

            You can use Muon to find installed versions of the package linux-image-generic (or just linux-image) to see which ones you have, or run apt list --installed | grep linux-image.

            Comment


              #8
              Yep, they should just disappear! This is exactly why I believe that one should routinely run:
              Code:
              sudo apt autoremove
              sudo apt autoclean
              sudo apt clean
              At present, this is what is left on my laptop:
              Code:
              WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
              
              linux-image-5.15.0-78-generic/jammy-updates,jammy-security,now 5.15.0-78.85 amd64 [installed,automatic]
              [linux-image-5.19.0-50-generic/jammy-updates,jammy-security,now 5.19.0-50.50 amd64 [installed,automatic]
              linux-image-6.2.0-26-generic/jammy-updates,jammy-security,now 6.2.0-26.26~22.04.1 amd64 [installed,automatic]
              linux-image-generic-hwe-22.04/jammy-updates,now 6.2.0.26.26~22.04.7 amd64 [installed,automatic]
              linux-image-generic/jammy-updates,jammy-security,now 5.15.0.78.75 amd64 [installed,automatic]

              With plenty of room for important "stuff":
              Code:
              [df -h
              Filesystem Size Used Avail Use% Mounted on
              tmpfs 1.6G 2.1M 1.6G 1% /run
              /dev/nvme0n1p2 48G 12G 34G 27% /
              tmpfs 7.7G 0 7.7G 0% /dev/shm
              tmpfs 5.0M 4.0K 5.0M 1% /run/lock
              /dev/nvme0n1p3 852G 308G 501G 39% /home
              /dev/nvme0n1p1 99M 6.1M 93M 7% /boot/efi
              tmpfs 1.6G 64K 1.6G 1% /run/user/1000
              Last edited by jglen490; Aug 07, 2023, 06:33 PM.
              The next brick house on the left
              Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



              Comment

              Working...
              X