Removing a kernel module

I found that window managers on Debian wouldnt start. After the login screen I would be taken back to the login screen. I had a hunch that it could be a faulty nvidia module, since I’ve had issues with it in the past even on Ubuntu.

So, I tried to remove it.

First, I tried the usual commands to remove a module:

modprobe -r nvidia

modprobe -rf nvidia

rmmod nvidia

 

All of these commands were telling me that the module was in use and couldnt be removed. So I tried to find the service or app using it, to try to kill it.

lsmod | grep 'nvidia'

 

instead of listing an app/service, showed a number 25, which apparently means 25 processes are using it (Not sure).

Anyway, since kdm was already running in the background, I thought I could kill it and unload the module. I was right.

service  kdm stop

An lsmod showed that nvidia wasnt in memory (0)

Now I was able to remove the module with:

rmmod nvidia

I then proceeded to recompile a new kernel module for nvidia

m-a

 

 

 

 

l