I've had to do this about 200 times this week for an out-of-tree vendor driver just this week.
With a current dkms version, this should be:
# Remove and uninstall the module from the current kernel sudo dkms remove -m <module> -v <version> -k $(uname -r) # or -k all
# Build and install the module for the current kernel sudo dkms install -m <module> -v <version> -k $(uname -r) # or -k all
I've had to do this about 200 times this week for an out-of-tree vendor driver just this week.
With a current dkms version, this should be:
# Remove and uninstall the module from the current kernel
sudo dkms remove -m <module> -v <version> -k $(uname -r) # or -k all
# Build and install the module for the current kernel
sudo dkms install -m <module> -v <version> -k $(uname -r) # or -k all