È possibile utilizzare il comando di installazione DKMS (Rif . man dkms
:) per ricostruire e installare il modulo per un kernel specifico. Di seguito un esempio creato rimuovendo i moduli virtualbox per una versione del kernel.
sudo dkms install <module-name>/<module-version> -k <kernel-version>
$ dkms status
vboxhost, 5.0.10, 4.2.0-21-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-22-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-23-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-25-generic, x86_64: installed
$ sudo dkms remove vboxhost/5.0.10 -k 4.2.0-22-generic
...
$ dkms status
vboxhost, 5.0.10, 4.2.0-21-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-23-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-25-generic, x86_64: installed
$ sudo dkms install vboxhost/5.0.10 -k 4.2.0-22-generic
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area....
make KERNELRELEASE=4.2.0-22-generic -C /lib/modules/4.2.0-22-generic/build M=/var/lib/dkms/vboxhost/5.0.10/build...............
cleaning build area....
DKMS: build completed.
vboxdrv.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.2.0-22-generic/updates/dkms/
vboxnetflt.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.2.0-22-generic/updates/dkms/
vboxnetadp.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.2.0-22-generic/updates/dkms/
vboxpci.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.2.0-22-generic/updates/dkms/
depmod....
DKMS: install completed.
$ dkms status
vboxhost, 5.0.10, 4.2.0-21-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-22-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-23-generic, x86_64: installed
vboxhost, 5.0.10, 4.2.0-25-generic, x86_64: installed