Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#1
Sometimes we have to update the kernel, sometimes for security, sometimes for features.

I recently updated the kernel on a fresh install of antiX 16.1 (security update) and all the dkms drivers were removed. This included the virtual box drivers and the broadcom wl drivers. The broadcom being particularly annoying because I need that one. __{{emoticon}}__

Here is a generic script that will force the rebuild of dkms kernel driver modules by reconfiguring their packages. Kinda like a reinstall, without having to download anything.

This script looks for installed packages with"-dkms" in the name, and runs dpkg-reconfigure on them. Is this perfect, no. but it will work for most of the usual dkms stuff from the debian repos.

What it won't work on is the nvidia or fglrx drivers installed with smxi. You'll have to fix those on your own (rerunning smxi is a good way to do that).

Code: Select all

#!/bin/bash

#script to rebuild dkms modules installed from deb packages
#dolphin oracle, March 2017
for i in $(dpkg-query -l |grep"\-dkms" |awk '{print $2'}); do
    dpkg-reconfigure $i |tee -a /var/log/rebuild-dkms.log
done