Remove a manually installed driver (wireless usb)

driversproprietary-driversusbwifi

I downloaded and installed a driver for my wireless usb dongle as it wasn't detected by linux (KDE). I wasn't very sure which model it was but apparently it is a Ralink RT2870 (Brand name IPTime N150UA).
I downloaded the driver, patched a file to make it compatible with my new kernel version (3 and above) following this page and finally installed it like shown in the page.
Then My wifi dongle was detected and I could connect to the network. The problem is, as soon as I do ssh or open the router's webpage my whole computer freezes and I have to shut it down.
Now I want to delete this driver, I searched on internet but couldn't find anything helpful. When I run lshw I get for my wireless driver:

description: Wireless interface
physical id: 1
logical name:
ra0
serial: 64:e5:99:f6:33:60
capabilities: ethernet physical
wireless
configuration: broadcast=yes driver=RALINK WLAN ip=192.168.1.8 multicast=yes wireless=Ralink STA

That is a very weird driver name with a space in the middle. I can't even follow some tutorials about how to get more information about a driver because when I input RALINK WLAN it thinks it is two different driver names.
What should I do?

Best Answer

According to your link the filename of the driver should be mt7601Usta.ko (.ko is the extension for kernel modules).

Kernel modules are usually installed in /lib/modules/$(uname -r), so use find /lib/modules/$(uname -r) -name mt7601Usta.ko then sudo rm to delete it if you're sure it is the right module (or mv to move it out from the modules tree so it won't be loaded on next boot).

But probably you'll need to unload the module before.

You can use lsmod command to see currently loaded modules and rmmod to unload a module for the current session (it would be loaded again on next boot), names from lsmod doesn't always correspond to filenames.

With lsmod results you can use modinfo command to get informations about the module (ie: modinfo <modulename>)

Depending on the distro you're using you may be able to blacklist adding a line in /etc/modprobe.d/blacklist.conf so it won't be loaded on boot

blacklist mt7601Usta

Add a new file if blacklist.conf doesn't exist

sudo sh -c 'echo "blacklist mt7601Usta" >/etc/modprobe.d/no-mt7601Usta.conf'

You can also blacklist it from the kernel command line (ie: grub bootloader)

modprobe.blacklist=mt7601Usta
Related Question