Sunday, September 24, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  68] [ 0]  / answers: 1 / hits: 135702  / 2 Years ago, thu, july 8, 2021, 5:01:50

Occasionally, my system gets into a state where some kernels are missing a module or two, because DKMS somehow forgot to compile those modules for that kernel. Rather than spend time diagnosing the problem, it would be nice if there was a single command I could run that woudl just rebuild every dkms-controlled module for every installed kernel. Is there such a command?

More From » kernel


I figured out a shell one-liner to do it:

ls /var/lib/initramfs-tools | 
sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start

This works because the names of the directories in /var/lib/initramfs-tools are exactly the kernel version names that you need to pass to dkms_autoinstaller to tell it to rebuild all modules for those kernel versions. Note that if you have uninstalled some old kernels, their directories might still be lying around and cause some errors to be reported, but this isn't a problem because dkms_autoinstaller will just do nothing for those kernel versions that aren't installed.

[#44204] Saturday, July 10, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 120
Total Questions: 126
Total Answers: 119

Location: Marshall Islands
Member since Wed, Feb 9, 2022
2 Years ago
gavgenerati questions
Wed, Jun 22, 22, 17:24, 1 Year ago
Fri, Jul 30, 21, 04:32, 2 Years ago
Fri, Jan 14, 22, 14:20, 2 Years ago
Tue, Jul 27, 21, 19:05, 2 Years ago