[SOLVED] Unable to build drivers for my Wi-Fi adapter (Realtek rtl88x2bu)

drivers
#1

I have a Dlink DWA-182 USB Wi-Fi adapter that requires a separately built driver. The official one doesn't support Kernel version 5, so I have been using this third party one on Ubuntu. However, I am trying to switch to OpenSUSE, where the driver build process doesn't seem to work.

I am using these commands as listed in the repository documentation:

git clone https://github.com/cilynx/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959
cd rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER}
sudo dkms install -m rtl88x2bu -v ${VER}
sudo modprobe 88x2bu

But the dkms commands return these errors:

[user@manjaro rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959]$ sudo dkms add -m rtl88x2bu -v ${VER}

Creating symlink /var/lib/dkms/rtl88x2bu/5.3.1/source ->
                 /usr/src/rtl88x2bu-5.3.1

DKMS: add completed.
[user@manjaro rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959]$ sudo dkms build -m rtl88x2bu -v ${VER}
Error! echo
Your kernel headers for kernel 4.19.28-1-MANJARO cannot be found at
/usr/lib/modules/4.19.28-1-MANJARO/build or /usr/lib/modules/4.19.28-1-MANJARO/source.
[user@manjaro rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959]$ sudo dkms install -m rtl88x2bu -v ${VER}
Error! echo
Your kernel headers for kernel 4.19.28-1-MANJARO cannot be found at
/usr/lib/modules/4.19.28-1-MANJARO/build or /usr/lib/modules/4.19.28-1-MANJARO/source.
[user@manjaro rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959]$ sudo modprobe 88x2bu
modprobe: FATAL: Module 88x2bu not found in directory /lib/modules/4.19.28-1-MANJARO

I am using Manjaro 18.0.4 with Kernel version 4.19.28-1-MANJARO, and I have no idea how kernel modules or Linux drivers work. What is going on here and how do I fix it?

#2

Update: I fixed it! Apparently I needed to install the following packages:

sudo pacman -S linux419-headers base-devel

And also reboot the system. I didn't think to do that the first time.

#3

Second update: For Linux 5.0.x, install these packages:

sudo pacman -S linux50-headers base-devel
#4

Just FYI the dkms driver in the AUR is built from the exact same source you used. Installing the driver from the AUR is not only easier but is probably better as far as keeping the diver up to date.

For others who are reading, this is the AUR package which would be better than compiling yourself:

rtl8822bu-dkms-git

The kernel headers, git, and dkms must be installed first as well.