Installing Network Card Drivers on Ubuntu

Preparations

Hardware:

  1. A USB drive
  2. An Ethernet cable

Software:

  1. make
  2. gcc

Installing the Software

Installing with an Ethernet Cable

Before compiling the drivers, you need to install make and gcc:

1
2
sudo apt-get update
sudo apt-get install build-essential

After running these commands, gcc, g++, and make will be installed. The build-essential package includes a complete set of tools such as gcc, libc, and more.

Offline Installation

  1. Check the version of make, then search for it in your browser: ftp://ftp.gnu.org/gnu/make/ to access the download page.
  2. Navigate to the directory where you want to store the files:
    cd /home/tool
  3. Download the installation package:
    wget http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
  4. Extract the tarball:
    tar -zvxf make-3.81.tar.gz
  5. Navigate to the extracted directory:
    cd make-3.81
  6. Configure make for your system:
    ./configure --prefix=/usr/local/make-3.81
  7. Compile the source:
    make
  8. Install make:
    sudo make install
  9. The sudo command is required here because this step moves the compiled version of make 3.81 to the /usr/local/make-3.81 directory, which only the root user has permission to write to.
  10. Verify the installation:
    make -v
    If it shows GNU Make 3.81, the installation was successful.

Installing the Driver

Step 1: Identify the Required Driver for Your Device

After connecting your wireless network card, use the command lsusb -tv to check device information:

Device Information

Here, 0bda:1a2b is the manufacturer ID:product ID, and Driver=usb-storage indicates the device has been recognized as a USB storage device. This happens because most driverless network cards store Windows drivers, so by default, they are recognized as USB drives, which are useless in Linux. We need to switch the device mode to recognize it as a network card. Run the following command to switch modes:

1
usb_modeswitch -KW 0bda -p 1a2b

Then run lsusb -tv again to check the device information:

After Switching Modes

At this point, the ID has changed from 0bda:1a2b to 0bda:b711, and the Driver= section is empty. I intentionally blanked out the details, as they will appear only after the driver is installed.

Next, go to www.linux-usb.org/usb.ids to find the chipset model based on the new ID (b711).

Chipset Model

As shown, the chipset is RTL8188GU, so we need to search for a third-party driver on GitHub for this chipset.

Step 2: Compile and Install the Driver

Go to https://github.com/McMCCRU/rtl8188gu and download the ZIP of the master branch to your local machine. Extract the files and navigate to the directory, then run make and make install:

1
2
make
make install

After completing these steps, you should see a new file 8188gu.ko in /lib/modules/5.4.0-90-generic/kernel/drivers/net/wireless/.

Driver File

The directory name 5.4.0-90-generic corresponds to the kernel version of your system, which may vary. You can check your version by running:

1
uname -a

Kernel Version

Next, load the newly installed driver module:

1
modprobe 8188gu

After this, run lsusb -tv again, and you’ll see that the Driver= section is now populated. Though it might not display rtl8188gu, this doesn’t affect functionality.

Driver Loaded

From now on, the network card will be automatically recognized whenever it’s plugged in or after rebooting.

Final Note

One more thing to note: if your system has automatic kernel updates enabled (which it typically does), the driver might stop working after a kernel update. This is because the driver was generated for the specific kernel version in use at the time of compilation, so you’ll need to recompile the driver for the new kernel.