Skip to content

Automatic kernel removal does not appear to be working #938

Closed

Description

@cplittlfield

Describe the bug
With automatic kernel removal enabled by going to Edit > Preferences > Automation and enabling "Remove obsolete kernels and dependencies" kernels older than the two most recent do not get removed.

Screenshots
If applicable, add screenshots to help explain your problem, you can just drag & drop them here.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Edit > Preferences > Automation'
  2. Click on 'Remove obsolete kernels and dependencies'
  3. Scroll down to '....'
  4. See error

Expected behavior
After waiting a week, the old kernels should no longer be listed as installed in Update Manager, and the kernel files should be gone from /boot

Distribution:

  • Linux Mint
  • LMDE
  • Other (please specify)

Version 7.0.7 of mintUpdate

Logs:
Copy & paste the log output from Update Manager > View > Information here.

Crash report:
If you are reporting a crash, please run mintupdate from a terminal window, reproduce the crash and copy & paste any output from the terminal window here.

Additional context
I thought was just me, until I saw this thread on the forums: https://forums.linuxmint.com/viewtopic.php?p=2614790#p2614790

Locale:
If the problem is with text not getting displayed correctly, paste the output of the terminal command locale.

Activity

  1. linuxminty commented on Apr 6, 2025

    @linuxminty

    I have the same problem with Update Manager in Mint 22.1. Attached is a screenshot showing the number of old kernels still installed even though I've enabled the automatic removal feature in Update Manager's preferences

    Image

  2. Doc-Dish commented on Apr 19, 2025

    @Doc-Dish

    I have the same issue (starting with kernel version 6.8.0-52). Kernels are also not removed with apt autoremove --purge.

  3. Elliot4444 commented on Apr 22, 2025

    @Elliot4444

    Same issue with the 6.11 kernels on Linux Mint 22.1.

    Image

  4. rjys365 commented on May 24, 2025

    @rjys365

    The autoremove service simply runs apt-get autoremove --purge periodically. So if the command doesn't remove obselete kernels, the automatic kernel removal can't work correctly. On my LM22.1 system, the command indeed doesn't remove them, so this may be the cause?

  5. MegaV0lt commented on May 28, 2025

    @MegaV0lt

    Same issue here. Old kernels don't get removed automaticly

    Image

  6. MegaV0lt commented on May 28, 2025

    @MegaV0lt

    The autoremove service simply runs apt-get autoremove --purge periodically.

    darkwing@MCP-Notebook ~ $ sudo apt-get autoremove --purge
    Paketlisten werden gelesen… Fertig
    Abhängigkeitsbaum wird aufgebaut… Fertig
    Statusinformationen werden eingelesen… Fertig
    0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
    

    No Errormessage, but also not removing old kernels

  7. Doc-Dish commented on Jul 4, 2025

    @Doc-Dish

    Following https://askubuntu.com/questions/1325387/why-is-apt-get-autoremove-failing-to-remove-my-old-kernels, I checked and all the linux-* packages are marked as manually installed. The page suggests marking all linux-* packages as manual, but this includes linux-base, linux-firmware & linux-generic. Removing them seems like a bad idea to me.

  8. git-developer commented on Oct 23, 2025

    @git-developer

    Linux Mint 22.2 is affected by this issue.

  9. dak151 commented on Nov 27, 2025

    @dak151

    Just seen this on a few Linux Mint installs of my own (22.2 Cinnamon) -- any updates on this?

  10. MegaV0lt commented on Nov 27, 2025

    @MegaV0lt

    Still not working (Cinnamon 22.2):

    Image
  11. Loufute commented on Dec 15, 2025

    @Loufute

    Hi all. Same issue here this very morning again (more than 10 kernels kept).
    Also discussed here : linuxmint/linuxmint#794

  12. MegaV0lt commented on Feb 7, 2026

    @MegaV0lt

    Image
    Still not removed here in Mint Cinnamon 22.3

  13. cancunia commented on Mar 13, 2026

    @cancunia

    Same here, only discovered the problem when my boot partition was full preventing the installation of new kernels. Removed old kernels manually no problem via the update manager 'view' option.

  14. JimmyS83 commented on Apr 13, 2026

    @JimmyS83

    Confirming also for LMDE 7. It used to work, but not anymore (found that by accident, when /boot was completelly filled up)

  15. Commander-Zal commented on Jun 22, 2026

    @Commander-Zal

    Can also confirm this is happening on multiple of my LMDE 7 installs.

    However, from what I gather, this appears like it might be an upstream bug either with Debian itself or in the Autoremove command, as I have seen the same behavior reported for both Ubuntu and Pure Debian. Can anyone find a discussion of this bug in any of the upstream projects?

  16. AlexB7 commented on Aug 13, 2026

    @AlexB7

    This issue is caused by Update Manager (mintupdate) not marking kernel installations and upgrades for auto removal. Running the apt-mark command will show that all of your kernel packages are marked as 'manual' instead of 'automatic':

    apt-mark showmanual | grep -E '^linux-(image|headers|modules)' | sort

    Running apt-mark showauto will likely return nothing:

    apt-mark showauto | grep -E '^linux-(image|headers|modules)' | sort

    A workaround for this is to use the apt command line for kernel upgrades instead as this will properly mark the kernel for automatic removal:

    apt update
    apt upgrade

    After running apt update/upgrade, you can run autoremove manually or wait for Update Manager to run it if you have the 'Remove obsolete kernels and dependencies' enabled in preferences (Update Manager runs apt-get autoremove --purge -y).

    To see what would be removed:

    apt autoremove --dry-run

    To remove:

    apt autoremove

    I have submitted PR #1081 to fix this issue. It was recently announced that the Linux Mint devs are moving kernel management from Update Manager to the System Administration tool for Linux Mint 23 so the problem should go away, but I don't know if they will be backporting this change to older versions so the fix may still be needed.

  17. clefebvre commented on Aug 19, 2026

    @clefebvre
    Member

    This was moved to mintsysadm and no longer relies on APT auto flags.

  18. janxkoci commented on Aug 26, 2026

    @janxkoci

    @clefebvre will this be backported to LMDE7 or should we expect it working only in LMDE8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions