Proper way of installing wifi drivers (rtl8822bu)

As I am running kernel 5.3.4 in Ubuntu MATE 19.04, for me it was the drivers from Cilynx's GitHub repo for RTL88x2BU that worked out OK.

As detailed in the repo, I've installed the drivers using DKMS installation method:

git clone https://github.com/cilynx/rtl88x2bu.git
cd rtl88x2bu
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

Since you are in the rtl8822bu directory, try

sudo dkms add .
sudo dkms install 8822bu/1.1

I had the same issue as you and I did as Jeremy 31 suggests in his answer. But even after all that lshw -C network didn't list the TP-LINK adapter, like nothing happened. What finally worked for me was switching the secure boot back on.

I am running Ubuntu 18.04 on a 5.4.0-42-generic kernel.