Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed a DKMS driver for a USB device from a PPA. I am making changes to the code and trying to uninstall the driver with apt-get --purge remove, but when I plug in the device, the kernel modules still load...why would this be? Where are they hiding?

Thanks in advance

share|improve this question

When you (or DKMS) builds a kernel module and installs it, they go to /lib/modules/$(uname -r)/..., so check there. One example from my system:

share|improve this answer
Hey thanks for the reply, but the modules are not showing up with lsmod and not appearing in /lib/modules/...etc... very strange. – Josif Jan 24 '13 at 10:24
You did reboot to make sure there are no traces left, didn't you? – Stefan Seidel Jan 24 '13 at 10:37
Yip indeed. Multiple time sin fact. Even tried a purge again and it said there's nothing to uninstall - yet the moment I plug in the device - the module starts running and causes a kernel panic. Before I had the driver installed I could plug it in without any problems as the system would just ignore it. – Josif Jan 24 '13 at 11:16
If you know the name of the kernel module, add a line saying "blacklist kernelmodulename" to /etc/modprobe.d/blacklist.conf. This should prevent loading the module. – Stefan Seidel Jan 28 '13 at 7:44

Installing and using kernel modules installed using DKMS involves several (mostly automated) steps:

  1. (in your case) Add the PPA sources, refresh the packages list.
  2. Install the DKMS package with the package manager (apt-get) which starts by copying the sources and automatic installation instructions to a standard directory (/usr/src/<module name>-<version>)
  3. DKMS copies the file to its private directory.
  4. DKMS compiles the source code of the kernel module in its private directory.
  5. DKMS copies the compiled kernel module file to the modules directory (usually /lib/modules/<kernel version>/updates)
  6. DKMS updates module dependencies so that you can use modprobe <modname> instead of insmod /lib/modules/<kernel version>/updates/<modname>.ko.
  7. You either load the kernel module manually (modprobe <modname>) or a system component (udev) does it for you when you plug in your USB device.

Steps 1-6 are undone when purging the package. Step 7 is not automatically undone. Typically, a module stays loaded after it has loaded unless you manually remove it with sudo rmmod <modname>. Use lsmod to find out what name your module has, usually this is the same as <modname>, but at least for nvidia drivers on Ubuntu, this is done different (you would use modprobe nvidia-current, but use rmmod nvidia).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .