Describe the bug
When removing old kernels through mintupdate's gui, the hwe kernel headers are not removed and stay present in /usr/src.
This can accumulate a decent amount of space over time. For example, I only have the 6.17.0-14-generic and 6.17.0-22-generic kernels installed through the mintupdate gui, but the following are hwe header folders are still present:
$ du -sh /usr/src/*
31M /usr/src/linux-headers-6.17.0-14-generic
31M /usr/src/linux-headers-6.17.0-22-generic
133M /usr/src/linux-hwe-6.14-headers-6.14.0-32
133M /usr/src/linux-hwe-6.14-headers-6.14.0-33
133M /usr/src/linux-hwe-6.14-headers-6.14.0-34
133M /usr/src/linux-hwe-6.14-headers-6.14.0-35
133M /usr/src/linux-hwe-6.14-headers-6.14.0-36
133M /usr/src/linux-hwe-6.14-headers-6.14.0-37
136M /usr/src/linux-hwe-6.17-headers-6.17.0-14
136M /usr/src/linux-hwe-6.17-headers-6.17.0-19
136M /usr/src/linux-hwe-6.17-headers-6.17.0-20
136M /usr/src/linux-hwe-6.17-headers-6.17.0-22
Screenshots

(Doesn't remove hwe header)
To Reproduce
Steps to reproduce the behavior:
- Go to 'View -> Linux Kernels'
- Click on an old kernel and click 'Remove'
- Note that hwe header is not listed in removal gui
- Continue with removal
- See that hwe header is still present in /usr/src
Expected behavior
Expected old hwe header to be removed and no longer present / taking up space in /usr/src
Distribution:
Linux Mint 22.3
Software version:
7.1.4
Logs:
2026.04.20@10:43 ++ Launching Update Manager
2026.04.20@10:43 ++ Initial refresh will happen in 0 day(s), 0 hour(s) and 10 minute(s)
2026.04.20@10:43 ++ Inhibited power management
2026.04.20@10:43 ++ Checking for updates
2026.04.20@12:28 ++ System is up to date
2026.04.20@12:28 ++ Refresh finished
2026.04.20@12:28 ++ Resumed power management
2026.04.20@12:37 ++ Update Manager is in tray mode; performing initial refresh
2026.04.20@12:37 ++ Auto refresh will happen in 0 day(s), 0 hour(s) and 1 minute(s)
2026.04.20@12:37 ++ Inhibited power management
2026.04.20@12:37 ++ Refreshing cache
2026.04.20@12:37 ++ Refreshing cache for Cinnamon updates
2026.04.20@12:37 ++ Refreshing cache for Flatpak updates
2026.04.20@12:38 ++ Checking for updates
2026.04.20@12:38 ++ System is up to date
2026.04.20@12:38 ++ Refresh finished
2026.04.20@12:38 ++ Resumed power management
2026.04.20@12:38 ++ Update Manager is in tray mode; performing auto refresh
2026.04.20@12:38 ++ Auto refresh will happen in 0 day(s), 1 hour(s) and 59 minute(s)
2026.04.20@12:38 ++ Inhibited power management
2026.04.20@12:38 ++ Refreshing cache
2026.04.20@12:38 ++ Refreshing cache for Cinnamon updates
2026.04.20@12:38 ++ Refreshing cache for Flatpak updates
2026.04.20@12:39 ++ Checking for updates
2026.04.20@12:39 ++ System is up to date
2026.04.20@12:39 ++ Refresh finished
2026.04.20@12:39 ++ Resumed power management
2026.04.20@16:07 ++ Update Manager is in tray mode; performing auto refresh
2026.04.20@16:07 ++ Auto refresh will happen in 0 day(s), 0 hour(s) and 1 minute(s)
2026.04.20@16:07 ++ Inhibited power management
2026.04.20@16:07 ++ Refreshing cache
2026.04.20@16:07 ++ Refreshing cache for Cinnamon updates
2026.04.20@16:07 ++ Refreshing cache for Flatpak updates
2026.04.20@16:07 ++ Checking for updates
2026.04.20@16:07 ++ Refresh finished
2026.04.20@16:07 ++ Found 1 software updates
2026.04.20@16:07 ++ Resumed power management
2026.04.20@16:08 ++ Update Manager is in tray mode; performing auto refresh
2026.04.20@16:08 ++ Auto refresh will happen in 0 day(s), 1 hour(s) and 59 minute(s)
2026.04.20@16:08 ++ Inhibited power management
2026.04.20@16:08 ++ Refreshing cache
2026.04.20@16:08 ++ Refreshing cache for Cinnamon updates
2026.04.20@16:08 ++ Refreshing cache for Flatpak updates
2026.04.20@16:08 ++ Checking for updates
2026.04.20@16:08 ++ Refresh finished
2026.04.20@16:08 ++ Found 1 software updates
2026.04.20@16:08 ++ Resumed power management
2026.04.20@16:18 ++ Inhibited power management
2026.04.20@16:18 ++ Refreshing cache
2026.04.20@16:18 ++ Refreshing cache for Cinnamon updates
2026.04.20@16:18 ++ Refreshing cache for Flatpak updates
2026.04.20@16:19 ++ Checking for updates
2026.04.20@16:19 ++ Found 1 software updates
2026.04.20@16:19 ++ Refresh finished
2026.04.20@16:19 ++ Resumed power management
2026.04.20@16:19 ++ Will install flatpak com.discordapp.Discord
2026.04.20@16:19 ++ Inhibited power management
2026.04.20@16:19 ++ Install requested by user
2026.04.20@16:19 ++ Resumed power management
2026.04.20@16:19 ++ Inhibited power management
2026.04.20@16:19 ++ Checking for updates
2026.04.20@16:19 ++ System is up to date
2026.04.20@16:19 ++ Refresh finished
2026.04.20@16:19 ++ Resumed power management
2026.04.21@16:30 ++ Update Manager is in tray mode; performing auto refresh
2026.04.21@16:30 ++ Auto refresh will happen in 0 day(s), 0 hour(s) and 1 minute(s)
2026.04.21@16:30 ++ Inhibited power management
2026.04.21@16:30 ++ Refreshing cache
2026.04.21@16:30 ++ Refreshing cache for Cinnamon updates
2026.04.21@16:30 ++ Refreshing cache for Flatpak updates
2026.04.21@16:31 ++ Checking for updates
2026.04.21@16:31 ++ Found 4 software updates
2026.04.21@16:31 ++ Refresh finished
2026.04.21@16:31 ++ Resumed power management
2026.04.21@16:31 ++ Tracker: Mintupdate update button was pressed recently: 1 days ago
2026.04.21@16:31 ++ Update Manager is in tray mode; performing auto refresh
2026.04.21@16:31 ++ Auto refresh will happen in 0 day(s), 1 hour(s) and 59 minute(s)
2026.04.21@16:31 ++ Inhibited power management
2026.04.21@16:31 ++ Refreshing cache
2026.04.21@16:31 ++ Refreshing cache for Cinnamon updates
2026.04.21@16:31 ++ Refreshing cache for Flatpak updates
2026.04.21@16:32 ++ Checking for updates
2026.04.21@16:32 ++ Found 4 software updates
2026.04.21@16:32 ++ Refresh finished
2026.04.21@16:32 ++ Resumed power management
2026.04.21@16:41 ++ Inhibited power management
2026.04.21@16:41 ++ Refreshing cache
2026.04.21@16:41 ++ Refreshing cache for Cinnamon updates
2026.04.21@16:41 ++ Refreshing cache for Flatpak updates
2026.04.21@16:42 ++ Checking for updates
2026.04.21@16:42 ++ Found 4 software updates
2026.04.21@16:42 ++ Refresh finished
2026.04.21@16:42 ++ Resumed power management
2026.04.21@16:51 ++ Will install libcap2-bin
2026.04.21@16:51 ++ Will install libcap2
2026.04.21@16:51 ++ Will install libpam-cap
2026.04.21@16:51 ++ Will install ntfs-3g
2026.04.21@16:51 ++ Will install libntfs-3g89t64
2026.04.21@16:51 ++ Will install flatpak com.obsproject.Studio
2026.04.21@16:51 ++ Will install spice copy-path-to-clipboard@claudiux
2026.04.21@16:51 ++ Inhibited power management
2026.04.21@16:51 ++ Install requested by user
2026.04.21@16:51 ++ Ready to launch aptkit
2026.04.21@16:52 ++ Install finished successfully
2026.04.21@16:52 ++ Resumed power management
2026.04.21@16:52 ++ Inhibited power management
2026.04.21@16:52 ++ Checking for updates
2026.04.21@16:52 ++ System is up to date
2026.04.21@16:52 ++ Refresh finished
2026.04.21@16:52 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@18:30 ++ Update Manager is in tray mode; performing auto refresh
2026.04.21@18:30 ++ Auto refresh will happen in 0 day(s), 0 hour(s) and 10 minute(s)
2026.04.21@18:30 ++ Refreshing cache
2026.04.21@18:30 ++ Refreshing cache for Cinnamon updates
2026.04.21@18:30 ++ Refreshing cache for Flatpak updates
2026.04.21@18:31 ++ Checking for updates
2026.04.21@18:31 ++ System is up to date
2026.04.21@18:31 ++ Refresh finished
2026.04.21@18:31 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@21:46 ++ Update Manager is in tray mode; performing auto refresh
2026.04.21@21:46 ++ Auto refresh will happen in 0 day(s), 0 hour(s) and 1 minute(s)
2026.04.21@21:46 ++ Refreshing cache
2026.04.21@21:46 ++ Refreshing cache for Cinnamon updates
2026.04.21@21:46 ++ Refreshing cache for Flatpak updates
2026.04.21@21:47 ++ Checking for updates
2026.04.21@21:47 ++ Found 1 software updates
2026.04.21@21:47 ++ Refresh finished
2026.04.21@21:47 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@21:47 ++ Update Manager is in tray mode; performing auto refresh
2026.04.21@21:47 ++ Auto refresh will happen in 0 day(s), 1 hour(s) and 59 minute(s)
2026.04.21@21:47 ++ Refreshing cache
2026.04.21@21:47 ++ Refreshing cache for Cinnamon updates
2026.04.21@21:47 ++ Refreshing cache for Flatpak updates
2026.04.21@21:48 ++ Checking for updates
2026.04.21@21:48 ++ Found 1 software updates
2026.04.21@21:48 ++ Refresh finished
2026.04.21@21:48 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@21:48 ++ Refreshing cache
2026.04.21@21:48 ++ Refreshing cache for Cinnamon updates
2026.04.21@21:48 ++ Refreshing cache for Flatpak updates
2026.04.21@21:48 ++ Checking for updates
2026.04.21@21:48 ++ Found 1 software updates
2026.04.21@21:48 ++ Refresh finished
2026.04.21@21:48 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@21:48 ++ Will install python3.12
2026.04.21@21:48 ++ Will install libpython3.12-minimal
2026.04.21@21:48 ++ Will install python3.12-venv
2026.04.21@21:48 ++ Will install libpython3.12t64
2026.04.21@21:48 ++ Will install python3.12-minimal
2026.04.21@21:48 ++ Will install libpython3.12-stdlib
2026.04.21@21:48 ++ Install requested by user
2026.04.21@21:48 ++ Ready to launch aptkit
2026.04.21@21:49 ++ Install finished successfully
2026.04.21@21:49 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
2026.04.21@21:49 ++ Checking for updates
2026.04.21@21:49 ++ Refresh finished
2026.04.21@21:49 ++ System is up to date
2026.04.21@21:49 ++ Could not uninhibit power management: GDBus.Error:org.gnome.SessionManager.GeneralError: Unable to uninhibit: Invalid cookie
Additional context
In the meantime, is it safe to just apt remove the old packages for these hwe headers? Thanks
Describe the bug
When removing old kernels through mintupdate's gui, the hwe kernel headers are not removed and stay present in /usr/src.
This can accumulate a decent amount of space over time. For example, I only have the 6.17.0-14-generic and 6.17.0-22-generic kernels installed through the mintupdate gui, but the following are hwe header folders are still present:
Screenshots

(Doesn't remove hwe header)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected old hwe header to be removed and no longer present / taking up space in /usr/src
Distribution:
Linux Mint 22.3
Software version:
7.1.4
Logs:
Additional context
In the meantime, is it safe to just apt remove the old packages for these hwe headers? Thanks