I just updated my EndeavourOS system which included upgrades for the lts and non-lts kernels. During the upgrade I noticed the system was reinstalling older lts kernels in addition to the newer one. It did not do this with the non-lts kernel, it just installed the new one and removed the old one. When the upgrade was complete I rebooted and selected the newer lts kernel to open the system, but I still have the older lts kernels on my system. This happens every time I upgrade and there is a kernel modification involved. I end up having to manually remove them. Can anyone tell me how to get EndeavourOS to clear the old kernels automatically? Many thanks!
I’m running EndeavourOS with systemd-boot, Dracut, Wayland, and Gnome desktop.
System kernels BEFORE upgrade:
6.18.53-1-lts;
7.2.6-arch2-1;
AFTER UPGRADE (2026-09-28):
❯ uname -r
6.18.54-1-lts
❯ pacman -Q linux linux-lts
linux 7.2.7.arch1-1
linux-lts 6.18.54-1
Thanks for your help MrSmartepants! Unfortunately sudo dracut-rebuild` didn't work, the old kernels are still there. Any idea as to why this keeps happening?
I have no idea why you’ve got leftovers. The system is usually very good at pruning the old kernel files. Best way is to remove the LTS kernel entirely, then reinstall (if you want it).
You can remove the LTS kernel entirely with AKM or via the terminal. sudo pacman -Rs linux-lts
Alternatively, If there are only the folders for the current kernel versions (stable & LTS), then it’s probably safe to delete the defunct boot entries.
*Edit, double check after uninstalling LTS for leftovers in /boot/* and /usr/lib/modules/* directories.
Before I remove anything completely, do the directories you mentioned look correct to you? There are still directories for older kernels in `/usr/lib/modules/*` that weren't listed above.
If you’ve already uninstalled the LTS kernels with AKM or Pacman, then yeah it’s safe to delete all those LTS folders from /usr/lib/modules/* (leave the /boot/ or /efi/ alone unless you KNOW what you’re doing)
Using AKM/Pacman will clean up the boot entries as well, so you’re just deleting old files. To be absolutely sure they’re not somehow dependencies/owned by an app, you could run sudo pacman -Qo /lib/modules/ because (I think) sometimes virtual machines store their kernels in there.
Saying that, you should wait for a more experienced member to chime in though. I’ve been using EnOS for less than two years.
Still showing old kernel directories
❯ sudo ls /usr/lib/modules/ | sort
6.18.49-3-lts
6.18.50-2-lts
6.18.51-1-lts
6.18.52-1-lts
6.18.53-1-lts
6.18.54-1-lts
7.2.7-arch1-1
Still showing old kernel directories
❯ sudo ls /efi/<my machine i> | sort
6.18.49-3-lts
6.18.50-2-lts
6.18.52-1-lts
6.18.53-1-lts
6.18.54-1-lts
7.2.4-arch1-2
7.2.7-arch1-1
What’s the best way to safely clean up the old kernel directories still showing in `/efi/<my machine i>` and `/usr/lib/modules` ? NOTE - there are no vmlinuz files in these older kernel directories, but there are various modules.xxx files.
Just updated my system which included updates to the linux-lts 6.18.54-2 and linux 7.2.8.arch1-2 kernels. Both installed fine and there were no redundant kernels remaining, so the solution provided worked great!