1

I have a problem with installing drivers for my wireless network adapter. When I try installing the drivers for my network adapter, everything goes fine until I have to make the driver after, every time that I try to make it always gives me Makefile Error 2. Anyone knows how to fix this? I'm using Ubuntu Budgie and trying to install drivers for TP-Link archer t2uh. After that I get this in terminal

make -C UTIL/ osutil
make[1]: Entering directory '/home/pleple66/Archer_T2UH_Linux/Driver/UTIL'
cp -f os/linux/Makefile.6.util /home/pleple66/Archer_T2UH_Linux/Driver/UTIL/os/linux/Makefile
make -C /lib/modules/5.4.0-21-generic/build SUBDIRS=/home/pleple66/Archer_T2UH_Linux/Driver/UTIL/os/linux modules
make[2]: Entering directory '/usr/src/linux-headers-5.4.0-21-generic'
arch/x86/Makefile:147: CONFIG_X86_X32 enabled but no binutils support
make[3]: *** No rule to make target 'arch/x86/tools/relocs_32.c', needed by 'arch/x86/tools/relocs_32.o'.  Stop.
make[2]: *** [arch/x86/Makefile:232: archscripts] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.4.0-21-generic'
make[1]: *** [Makefile:528: osutil] Error 2
make[1]: Leaving directory '/home/pleple66/Archer_T2UH_Linux/Driver/UTIL'
make: *** [Makefile:3: all] Error 2
Tilman
  • 3,325
  • 18
  • 25
pleple66
  • 51
  • 4
  • Also I forgot to mention that I do have a access to internet but it's much slower than it should be – pleple66 Apr 07 '20 at 20:07
  • My first recommendation would be to get a wireless adapter that is supported directly by Ubuntu instead of one you have to manually install a driver for. There's plenty of choice. – Tilman Apr 07 '20 at 20:42
  • Second, if you insist on using this particular adapter, please list the actual commands you're using to install the driver, and the output they produce. `Makefile Error 2` is in all probability just the last line of that output, while the actual problem is displayed earlier on. – Tilman Apr 07 '20 at 20:44
  • Here are the commands I use cd Archer_T2UH_Linux/ cd Driver/ sudo make – pleple66 Apr 07 '20 at 21:03
  • And this is what I get after – pleple66 Apr 07 '20 at 21:04
  • make -C UTIL/ osutil make[1]: Entering directory '/home/pleple66/Archer_T2UH_Linux/Driver/UTIL' cp -f os/linux/Makefile.6.util /home/pleple66/Archer_T2UH_Linux/Driver/UTIL/os/linux/Makefile make -C /lib/modules/5.4.0-21-generic/build SUBDIRS=/home/pleple66/Archer_T2UH_Linux/Driver/UTIL/os/linux modules make[2]: Entering directory '/usr/src/linux-headers-5.4.0-21-generic' LEX scripts/kconfig/lexer.lex.c /bin/sh: 1: flex: not found make[4]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127 make[3]: *** [Makefile:594: syncconfig] Error 2 – pleple66 Apr 07 '20 at 21:05
  • make[2]: *** [Makefile:704: include/config/auto.conf.cmd] Error 2 make[2]: Leaving directory '/usr/src/linux-headers-5.4.0-21-generic' make[1]: *** [Makefile:528: osutil] Error 2 make[1]: Leaving directory '/home/pleple66/Archer_T2UH_Linux/Driver/UTIL' make: *** [Makefile:3: all] Error 2 – pleple66 Apr 07 '20 at 21:05
  • 1
    You should have added that to the text of your question instead of writing it into comments. That would have allowed you to format it properly. Anyway, here's your problem: `/bin/sh: 1: flex: not found`. That driver requires the `flex` command for building, which you haven't installed on your system. – Tilman Apr 07 '20 at 21:15
  • Thank you, but now I get a brand new error – pleple66 Apr 08 '20 at 10:31
  • @pleple66 I don't think this unedited source code will compile on a newer kernel but maybe I'm wrong. However, have you tried using `mt76x0u` which doesn't need to be installed? Just run: `sudo modprobe mt76x0u` – mchid Aug 30 '20 at 10:30
  • @pleple66 Also, it would help to post a link to the code so we can review it. Often times there are options commented out that can make a difference and someone may also be able to figure out what needs to be edited to get it to run on a newer kernel. – mchid Aug 30 '20 at 10:30

3 Answers3

0

Your system lacks basic packages for compiling kernel modules. The compilation instructions for the TP-Link archer t2uh are woefully incomplete in that respect. Install at least the build-essential and kernel-headers packages as described here before trying again.

Tilman
  • 3,325
  • 18
  • 25
0

I'm pretty sure you don't need to install the firmware on a newer kernel as it's built in.

First, make sure the linux-firmware and extra module packages are installed

sudo apt update
sudo apt dist-upgrade
sudo apt install linux-firmware linux-image-generic 

note: if you downloaded and manually installed Nvidia drivers from the Nvidia website you will also need to run sudo ubuntu-drivers autoinstall to reinstall the drivers

Next, reboot to make sure you're running on the latest kernel.

Finally, run the following command to enable the driver for your device:

sudo modprobe mt76x0u

You may have to run that before you plug the device in or you might have to plug the device in before you run that command to enable the driver.

Please comment below if this doesn't work.

mchid
  • 42,315
  • 7
  • 94
  • 147
-2

i386 headers required:

sudo apt-get install linux-headers-*(kernel version)*:i386

Example:

sudo apt-get install linux-headers-5.4.0-42:i386
Zanna
  • 69,223
  • 56
  • 216
  • 327
Thantelius
  • 61
  • 1