4

I have a dkms module. I wanted to remove it. I did sudo dkms remove .... But when I update to a newer kernel, my package manager tries to build that module and failed, so it added it again.

How do I prevent that and remove the module?

1
  • 1
    Can you please post the output of pacman when installing a newer kernel? Are you sure that the module's DKMS tarball or folder is not present in the /usr/src directory? And also /var/lib/dkms/ ? Commented Jul 24, 2020 at 11:01

2 Answers 2

11

To remove the module, you need to run sudo dkms remove modul/version --all to prevent it from being rebuilt during the next update, you must also remove the sources under /usr/src/.

here is an example of how to remove akvcam module

dkms status

akvcam, 1.2.0, 5.12.14-arch1-1, x86_64: installed

sudo dkms remove akvcam/1.2.0 --all
sudo rm -rf /usr/src/akvcam-1.2.0/
sudo rm /etc/modprobe.d/akvcam.conf

good luck marco manngatter

3
  • Thanks! I'm new to Ubuntu, and this saved a lot of headache for me. Commented Mar 8, 2022 at 4:33
  • Is it necessary to rm /var/lib/dkms/{module} too or is that what the dkms remove cmd is essetially doing?
    – tijko
    Commented Sep 15, 2022 at 16:34
  • In my case, I have to delete /var/lib/dkms/{module} as some module version won't be deleted with command dkms remvoe {module}/{version} --all Commented Mar 17, 2023 at 1:15
0

Cleaning DKMS To clean DKMS, you can use the command dkms remove <module-name> --all to remove all versions of the specified module. This prepares your system for a fresh reinstall. source Reinstalling DKMS To reinstall DKMS, first make sure you have the DKMS package and the necessary kernel headers installed. You can do this with the command: sudo apt install dkms and sudo apt install linux-headers-$(uname -r). source Rebuilding DKMS Modules After reinstalling, if you need to rebuild existing DKMS modules, use the command dkms build <module-name> followed by dkms install <module-name>. This ensures your modules are compatible with the current kernel.

just a continuation post for more help if a second issue occure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.