A few months ago, I bought an Alfa AWUS036ac USB wireless adapter, since my desktop is no longer near an ethernet port. Some work is needed to help the thing be recognized as a wlan device on Ubuntu.

Recent changes to GCC and libc, though, have made it a little more complicated than just following the instructions provided with the Linux driver.

In the hope that someone might be helped a little bit by this, here’s what I did to get the AWUS036ac working on Ubuntu 15.10.

  1. Untar rtl8821AU_linux_v4.3.14.13455.20150212_BTCOEX20150128-51.tar.gz. You’ll need to make some changes.

  2. Recent GCCs error if the build is non-reproducible because of using the date or time macros. In the driver directory, add the following to the Makefile:

    EXTRA_CFLAGS += -Wno-error=date-time
  3. You’ll need to comment out section of install.sh that extracts the tarball, since, of course, you don’t want your changes overwritten.

  4. file_path is now an exported symbol, so there will be an error for redfinition: redeclared as different kind of symbol. To fix this, you’ll need to rename the file_path variable in the driver source something else. You can do this by entering the driver directory and running

    find . -type f | xargs sed -i 's/file_path/file_path_custom/g'
  5. In driver/rtl.../os_dep/linux/, you’ll need to edit rtw_android.c to avoid using strnicmp, since that’s not in the C standard. You’ll need to make a quick change by adding the following line:

    #DEFINE strnicmp strncasecmp
  6. Then, just run the changed install.sh script as root. The driver should install. If you update your kernel at all (as Ubuntu is wont to do), you’ll need to re-run the script, but you won’t need to make all these changes again.

I got a lot of this stuff from http://askubuntu.com/questions/573737/alfa-awus036ac-usb-wifi-adapter and http://stackoverflow.com/questions/1784767/.

Edit [2016-05-03]: On upgrading to Ubuntu 16.04, with its 4.4 kernel, there was an additional change. In the driver directory, in rtw_debug.h, there are a couple errors because seq_printf is void, not int. So, there are two places where you’ll need to get rid of the if surrounding use of _seqdump, which is on lines 232 and 242.