16

I have 2 dkms modules are in same version:

$ dkms status
rtl8812AU, 4.3.14, 4.4.0-45-generic, x86_64: installed
rtl8812AU, 4.3.14, 4.4.0-47-generic, x86_64: installed

When I tried dkms uninstall -m rtl8812AU -v 4.3.14 it uninstalled the second one. How do I uninstall the first one? Thanks!

user3928256
  • 263
  • 1
  • 2
  • 5
  • Don't you want both installed so you can boot either kernel? – WinEunuuchs2Unix Nov 15 '16 at 01:15
  • The thing is my wifi adapter is not working now, just after I update the OS. Would like to try uninstalling one to see whether it will work again. – user3928256 Nov 15 '16 at 01:33
  • What do you really want? Do you want to uninstall both? These are two builds of the same module. – Pilot6 Nov 15 '16 at 10:49
  • I doubt that will help. See my answer for why that doesn't do what you seem to think. If you want help with your wireless adapter problem please open a new question and include the output of `lspci -nnk | grep -A2 Network` or better yet [run the network diagnostics](//askubuntu.com/a/425205/175814). – David Foerster Nov 15 '16 at 10:49

2 Answers2

30

To remove the module for all kernels you can run

sudo dkms remove rtl8812AU/4.3.14 --all
Pilot6
  • 88,764
  • 91
  • 205
  • 313
  • 1
    `--all` is not supported on older versions of dkms. I.E. Ubuntu 14.04 gives `Error! The action does not support multiple kernel version parameters on the command line.` – Tino Jul 17 '17 at 14:59
18

You don't have two DKMS modules. You have one DKMS module built and installed for two different kernel versions.

As a rule of thumb you shouldn't manually uninstall DKMS modules for kernels that are still installed unless you have a specific reason. (There’s no need to manually uninstall modules for kernels removed through the package manager as DKMS already takes care of that via package removal hooks – assuming the kernel was packaged correctly.)


If you really want to uninstall the module for a particular kernel, you can refer to the dkms(8) manual:

-k <kernel-version>/<arch>

The kernel and arch to perform the action upon. You can specify multiple kernel version/arch pairs on the command line by repeating the -k argument with a different kernel version and arch. However, not all actions support multiple kernel versions (it will error out in this case). The arch part can be omitted, and DKMS will assume you want it to be the arch of the currently running system.

So the command to uninstall the module in question for kernel 4.4.0-45-generic is:

dkms uninstall -k 4.4.0-45-generic rtl8812AU

You can omit the module version since you can't install multiple versions of a module for the same kernel anyway.

David Foerster
  • 35,754
  • 55
  • 92
  • 145