I have been looking for a proven reliable way to use USB drive as an apt repository and simply apt-get install the prerequisites for the driver. I have, so far, been unsuccessful. I propose another method that will get the prerequisites build-essential and dkms installed.
This method, although it is tedious, will work. The list of deb files you need is this: https://pastebin.ubuntu.com/p/q8DzXnzFNq/
Create a folder on your desktop to hold the files. I suggest:
mkdir ~/Desktop/debs
Browse the USB drive and look in pool/main/b for build-essential; in pool/main/d for dkms and dpkg-dev; in pool/main/f for fakeroot and so on. Continue until every package on the list I provided is dragged into the debs folder.
Now, back to the terminal:
cd ~/Desktop/debs
sudo dpkg -i *.deb
Now let’s install the driver. Download this file on some other computer and transfer it to the Desktop of your Ubuntu computer on a USB drive or similar: https://github.com/aircrack-ng/rtl8812au/archive/refs/heads/v5.6.4.2.zip
In the terminal, do:
cd ~/Desktop
unzip rtl8812au-5.6.4.2
cd rtl8812au-5.6.4.2
sudo make dkms_install
sudo modprobe 88XXau
Your wireless should now be working.