Too many DKMS entries . Taking forever to do an update

I am on unstable and seem to have created too many DKMS entries.
How do I clean this mess up?
Thanks

(14/36) Install DKMS modules
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.3-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.2-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.6-2-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.1-2-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.1-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.9-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.9-3-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.8-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.5-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.4-1-MANJARO
==> dkms install --no-depmod vboxhost/7.0.18_OSE -k 6.9.8-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.2-2-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.3-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.5-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.6-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.2-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.9-2-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.7.9-1-MANJARO
Error! Bad return status for module build on kernel: 6.7.9-1-MANJARO (x86_64)
Consult /var/lib/dkms/nvidia/555.58.02/build/make.log for more information.
==> WARNING: `dkms install --no-depmod nvidia/555.58.02 -k 6.7.9-1-MANJARO' exited 10
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.7-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.12-3-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.8-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.8.1-1-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.3-3-MANJARO
==> dkms install --no-depmod nvidia/555.58.02 -k 6.9.1-2-MANJARO
==> depmod 6.9.3-3-MANJARO
==> depmod 6.9.5-1-MANJARO
==> depmod 6.9.3-1-MANJARO
==> depmod 6.8.1-2-MANJARO
==> depmod 6.8.3-1-MANJARO
==> depmod 6.8.12-3-MANJARO
==> depmod 6.8.2-1-MANJARO
==> depmod 6.8.9-2-MANJARO
==> depmod 6.8.7-1-MANJARO
==> depmod 6.8.4-1-MANJARO
==> depmod 6.9.2-1-MANJARO
==> depmod 6.8.2-2-MANJARO
==> depmod 6.8.9-1-MANJARO
==> depmod 6.8.9-3-MANJARO
==> depmod 6.8.8-1-MANJARO
==> depmod 6.9.1-2-MANJARO
==> depmod 6.8.5-1-MANJARO
==> depmod 6.8.6-1-MANJARO
==> depmod 6.9.8-1-MANJARO
==> depmod 6.8.1-1-MANJARO
==> depmod 6.9.1-1-MANJARO
==> depmod 6.8.6-2-MANJARO
==> ERROR: Missing 5.10.221-1-MANJARO kernel modules tree for module nvidia/555.58.02.
==> ERROR: Missing 5.10.221-1-MANJARO kernel modules tree for module vboxhost/7.0.18_OSE.

You probably have this kernel hook installed, that copies all the old modules back after a kernel update.

There is a cleanup script but I guess it doesn’t run? You can remove all directories that don’t match your installed kernels.

1 Like

ls -al /usr/lib/modules
and
ls -al /etc/mkinitcpio.d

this should correspond to the kernels you have installed

dito for the named and numbered entries in /boot for initramfs* vmlinuz* and linux*
ls /boot/

mhwd-kernel -li tells you what is actually installed

It does not, if you have kernel-modules-hook installed. It keeps /usr/lib/modules populated with the currently installed modules, so that you can use them after upgrading the kernel without a reboot.
Unfortunately, it doesn’t clean up after itself properly.

That is what I had noticed on my own system and that is what I meant.
I had to manually “help” the flawed automatism along by removing things that didn’t belong anymore.
I can’t remember what places where affected so I listed all of them …

[demo@Manjaro ~]$ ls -al /usr/lib/modules
total 404
drwxr-xr-x  26 root root   4096 Jul  6 21:40 .
drwxr-xr-x 275 root root 307200 Jul  7 06:19 ..
drwxr-xr-x   3 root root   4096 Jul  6 21:39 5.10.221-1-MANJARO
drwxr-xr-x   5 root root   4096 Mar 15 21:12 6.7.9-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.1-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.12-3-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.1-2-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.2-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.2-2-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.3-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.4-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.5-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.6-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.6-2-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.7-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.8-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.9-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.8.9-2-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.8.9-3-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.9.1-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.9.1-2-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.9.2-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.9.3-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.9.3-3-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:24 6.9.5-1-MANJARO
drwxr-xr-x   5 root root   4096 Jul  7 01:25 6.9.8-1-MANJARO
[demo@Manjaro ~]$ ls -al /etc/mkinitcpio.d
total 88
drwxr-xr-x   2 root root  4096 Jul  6 23:02 .
drwxr-xr-x 129 root root 12288 Jul  7 06:19 ..
-rw-r--r--   1 root root   396 Jan 20  2022 linux414.preset.pacsave
-rw-r--r--   1 root root   392 Jan 18  2022 linux44.preset.pacsave
-rw-r--r--   1 root root   396 Jan 18  2022 linux510.preset.pacsave
-rw-r--r--   1 root root   396 Jan  3  2022 linux515.preset.pacsave
-rw-r--r--   1 root root   396 Jan 18  2022 linux516.preset.pacsave
-rw-r--r--   1 root root   408 Feb 19  2022 linux516-rt.preset.pacsave
-rw-r--r--   1 root root   408 Apr 26  2022 linux517-rt.preset.pacsave
-rw-r--r--   1 root root   396 Jul 16  2022 linux518.preset.pacsave
-rw-r--r--   1 root root   408 Jun 16  2022 linux518-rt.preset.pacsave
-rw-r--r--   1 root root   408 Aug 27  2022 linux519-rt.preset.pacsave
-rw-r--r--   1 root root   392 Jan 18  2022 linux54.preset.pacsave
-rw-r--r--   1 root root   392 Oct 16  2022 linux60.preset.pacsave
-rw-r--r--   1 root root   395 Mar 18  2023 linux61.preset.pacsave
-rw-r--r--   1 root root   577 Jun 24  2023 linux63.preset.pacsave
-rw-r--r--   1 root root   577 Jun 24  2023 linux64.preset.pacsave
-rw-r--r--   1 root root   515 May  7 11:03 linux67.preset
-rw-r--r--   1 root root   515 May  7 11:03 linux68.preset
-rw-r--r--   1 root root   566 Jul  6 23:02 linux69.preset
[demo@Manjaro ~]$ mhwd-kernel -li
Currently running: 6.9.8-1-MANJARO (linux69)
The following kernels are installed in your system:
   * linux68
   * linux69

So based on this result I should delete all of those module folders except for 68 and 69 ones?
But that still leaves allot of entries in there?

If you’re too lazy (or too comfortable :wink: ), you could remove all of them, but then you have to reinstall (!) the kernels that you want to keep.

1 Like

Lazy I’m not comfortable I might be. lol

[demo@Manjaro ~]$ uname -a
Linux Manjaro 6.9.8-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat Jul  6 05:51:22 UTC 2024 x86_64 GNU/Linux

I like having 2 kernels. The latest and the one previous just in case the latest has issues.
So I would like to keep in my case the 6.9.8 and the 6.8.9-3 modules and delete the rest.
Also I will delete all the presets and pacsave presets that I didn’t deal with previous to 6.8.
Does this sound safe and ok?

1 Like

There is only one subversion of a kernel at any one time.
See what is current and installed -
current is:
linux68-6.8.12-3
and
linux69-6.9.5-1

… and:
linux510-5.10.219-1

The rest can go.

The other ones are not available anymore (to be installed).

The easy way is:
remove all of that, then reinstall the two kernels that you’d like to have.

6.7 series:
6.7.9-1-MANJARO

is not available anymore at all → can go as well

Yes. This sounds reasonable.
But in any case, keep a thumb drive with a live iso at hand to fix issues.

To be even more safe, you could reinstall your current kernels which will recreate the modules if you deleted the wrong files by accident.

Ok modules and presets deleted.
System is running fine.
Thanks for the help with this cleanup.
I will keep an eye on this in the future.

2 Likes

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