Several old unused modules under /usr/lib/modules

Hi all,

in /usr/lib/modules there are several - imho - unused module directories.

  /usr/lib/modules  ls -la                                                                  ✔ 
insgesamt 328
drwxr-xr-x  10 root root   4096  8. Dez 04:51 .
drwxr-xr-x 310 root root 294912 10. Dez 14:38 ..
drwxr-xr-x   6 root root   4096  8. Dez 04:52 6.12.61-1-MANJARO
drwxr-xr-x   6 root root   4096  6. Nov 08:07 6.17.5-1-MANJARO
drwxr-xr-x   6 root root   4096 11. Nov 11:24 6.17.7-1-MANJARO
drwxr-xr-x   6 root root   4096 15. Nov 06:47 6.17.7-2-MANJARO
drwxr-xr-x   6 root root   4096 25. Nov 06:33 6.17.8-2-MANJARO
drwxr-xr-x   5 root root   4096  8. Dez 04:52 6.18.0-1-MANJARO
drwxr-xr-x   5 root root   4096 19. Nov 09:52 6.18.0-rc6-1-MANJARO
drwxr-xr-x   5 root root   4096  2. Dez 14:39 6.18.0-rc7-1-MANJARO

Installed kernels are 6.12 and 6.18, but indeed the other kernels were installed as well, but removed via manjaro-settings-manager.

Two questions I would have

  1. is it save to delete this folders for kernels not installed anymore (I would say “yes”, but just want to get the feedback from the ones who know and not like me … guess)

  2. more interesting: why are this folders on the disc if the kernels were removed. I am just curious if this is just on my disc or if some others could save space and delete this folders as well …

Best, and thanks for your time
Joerg

Yes, you can remove them by hand.

Presumably because of a bug in mhwd, or the incorrect use of such. They should have been removed automatically when removing the old kernels.

Thanks @Aragorn ! Appreciated.

Eventually something like a “cleanup of old modules” in mhwd should be implemented to get rid of the old stuff on other systems as well.

1 Like

Well, that would be difficult to implement, given that the package manager has no way of knowing about things that were installed outside of its scope, or that were left over by some buggy or incorrect removal procedure. :wink:

Understood.

Probably a hint / announcement / … within the forum for the users could be done to check this folder.

That was 2GB on my disc that I could free up with 2 rm -rf …
That is a lot of waste, isn’t it?

2 Likes

Looks like I have some cleaning up to do as well.

modules]$ ls -la
total 300
drwxr-xr-x  22 root root   4096 Dec  8 06:35 .
drwxr-xr-x 202 root root 208896 Dec 10 08:09 ..
drwxr-xr-x   3 root root     21 Oct 12  2022 5.15.72-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 16  2022 5.15.73-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 27  2022 5.15.74-4-MANJARO
drwxr-xr-x   3 root root     21 Oct 29  2022 5.15.75-1-MANJARO
drwxr-xr-x   3 root root     21 Nov  3  2022 5.15.76-1-MANJARO
drwxr-xr-x   3 root root     21 Nov  6  2022 5.15.77-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 12  2022 5.19.14-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 16  2022 5.19.15-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 17  2022 5.19.16-4-MANJARO
drwxr-xr-x   3 root root     21 Oct 22  2022 6.0.2-3-MANJARO
drwxr-xr-x   3 root root     21 Oct 27  2022 6.0.3-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 29  2022 6.0.5-1-MANJARO
drwxr-xr-x   3 root root     21 Oct 31  2022 6.0.6-1-MANJARO
drwxr-xr-x   3 root root     21 Nov  3  2022 6.0.6-2-MANJARO
drwxr-xr-x   3 root root     21 Nov  6  2022 6.0.7-1-MANJARO
drwxr-xr-x   2 root root     29 Aug 17  2024 6.10.5-1-MANJARO
drwxr-xr-x   5 root root   4096 Dec  8 06:38 6.12.61-1-MANJARO
drwxr-xr-x   5 root root   4096 Dec  8 06:38 6.17.11-1-MANJARO
drwxr-xr-x   5 root root   4096 Dec  6 02:38 6.18.0-1-MANJARO
drwxr-xr-x   2 root root     29 Aug 19  2024 6.6.46-1-MANJARO

2 Likes

Well, as I said, they should have been cleaned out automatically, but if you install or remove kernels without using mjwd-kernel, then those will not be removed.

But I notice that I too still have leftover modules from 6.1 — I’ve been running 6.12 for quite a long time now — and @straycat’s post here-above suggests that there is indeed a problem. So I will post a Manjaro Development > QA thread about it. :wink:

Thank you for noticing. :wink: :clinking_beer_mugs:

Possibly with a single “rm -rf” if you know your shell-fu. :stuck_out_tongue:


Edit:

Here it is… :backhand_index_pointing_down:

:wink:

3 Likes

you are welcome. Cheers …:clinking_beer_mugs:

1 Like

Just to add all the removed kernels contain 2 folders updates/dkms and are empty.

1 Like

I suspect that one kernel-modules-hook which copies the models from the currently running kernel back after updating. I’ve experienced this as well and my solution is just rebooting after a kernel update.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.