Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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:

/lib/modules/3.2.0-36-generic-pae/updates/dkms/nvidia_current_updates.ko
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.