I am having trouble installing the driver for TP-Link AC1300 dongle in Red Hat.
I followed this procedure for Ubuntu and it ultimately worked.
Have been trying to follow the same steps in Red Hat, to no avail.

  1. Not sure how does one figure out what is the driver to install on Linux. The official site does not mention Linux support in the driver page.
  2. Following the tracks on google, I must assume it's realtek driver. Possibly this, perhaps this.
  3. Tried the procedure I understand needs to be done:
    • cloning source code
    • adding symbolic link with dkms
    • install module using dkms

I can't get passed the 3rd bullet - install module with dkms.
Tried (using (this source code)2) sudo dkms install -m 8812au -v 4.2.2

Error! Your kernel headers for kernel 3.10.0-1160.el7.x86_64 cannot be found at /lib/modules/3.10.0-1160.el7.x86_64/build or /lib/modules/3.10.0-1160.el7.x86_64/source.
Please install the linux-headers-3.10.0-1160.el7.x86_64 package or use the --kernelsourcedir option to tell DKMS where it's located.

There is one install.sh in the source code folder. Running it gives

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.10.0-1160.el7.x86_64/build M=/home/qa_user/avraham/rtl8812au  modules
make: *** /lib/modules/3.10.0-1160.el7.x86_64/build: No such file or directory.  Stop.
make: *** [modules] Error 2

If I try looking at what is at /lib/modules/3.10.0-1160.el7.x86_64/build, I figure out it is a link, pointing to /usr/src/kernels/3.10.0-1160.49.1.el7.x86_64. Trying again dkms install this time with --kernelsourcedir to the link above, like:
sudo dkms install -m 8812au -v 4.2.2 --kernelsourcedir /usr/src/kernels/3.10.0-1160.49.1.el7.x86_64

Building module:
cleaning build area...
'make' all KVER=3.10.0-1160.el7.x86_64...(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.10.0-1160.el7.x86_64 (x86_64)
Consult /var/lib/dkms/8812au/4.2.2/build/make.log for more information.

Looking at the log gives

DKMS make.log for 8812au-4.2.2 for kernel 3.10.0-1160.el7.x86_64 (x86_64)
Wed Dec  8 16:19:11 EST 2021
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.10.0-1160.el7.x86_64/build M=/var/lib/dkms/8812au/4.2.2/build  modules
make: *** /lib/modules/3.10.0-1160.el7.x86_64/build: No such file or directory.  Stop.
make: *** [modules] Error 2

which is the error I got at the beginning, meaning... I am stuck.

Update (1):

Followed @GracefulRestart suggestion. Tried installing the kernel headers for my linux kernel version.

My linux kernel version (hostnamectl output): Kernel: Linux 3.10.0-1160.el7.x86_64

Ran sudo yum install -y kernel-headers-3.10.0-1160.el7.x86_64.rpm. Got message

warning: /var/tmp/rpm-tmp.GncnUX: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
    package kernel-headers-3.10.0-1160.49.1.el7.x86_64 (which is newer than kernel-headers-3.10.0-1160.el7.x86_64) is already installed
    file /usr/include/linux/version.h from install of kernel-headers-3.10.0-1160.el7.x86_64 conflicts with file from package kernel-headers-3.10.0-1160.49.1.el7.x86_64

I then removed kernel version 49.

Currently I have only what seems to be the proper kernel header:
rpm -qa kernel
Returns kernel-3.10.0-1160.el7.x86_64 only.

As pointed by @Natolio, I should have ran rpm -qa kernel-headers.
Done, and the result is kernel-headers-3.10.0-1160.el7.x86_64.

Update (2):

Went to /usr/src/kernels/3.10.0-1160.el7.x86_64 and tried running make there.

make[1]: *** No rule to make target arch/x86/syscalls/syscall_32.tbl', needed by arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'.  Stop.
make: *** [archheaders] Error 2

Update (3):

Running lsusb I figured out that I was trying (I did not know how to determine the matching driver !) the wrong driver source code. I have the dongle connected to the computer, and lsusb shows TP-Link Archer T3U [\[Realtek RTL8812BU\]][5]. But following both the source code instructions to install or the procedure I was using originally with dkms - the result is the same.

How do I find solace here ?

  • Those errors seem to indicate that you have not installed the kernel headers for your currently running kernel. Make sure that the kernel-headers package is installed and the same version as your running kernel. Dec 9, 2021 at 1:17
  • 1
    Minor formatting comment: error messages are generally better formatted as code, because they have a specific format, and are easier to read if they are in that format. Dec 9, 2021 at 10:14
  • 1
    From your Update (1) it is unclear if you actually got the kernel-headers installed. The warning message stated that you had a newer version than what you were trying to install already installed at that it caused a conflict. Then you uninstalled the version of the kernel that you had the kernel-headers for (49). Did you then install the kernel-headers for the kernel that you were running? rpm -qa kernel will show you the versions of the kernel that you have installed, not the kernel-headers. Confirm that you have the correct version of kernel-headers installed. Run rpm -qa kernel-headers.
    – Natolio
    Dec 9, 2021 at 15:01
  • 1
    @Natolio: oops, good catch. Update (1) section updated. Thanks. It shows the matching version of the kernel header is installed.
    – Veverke
    Dec 9, 2021 at 15:36
  • 1
    Redhat : The package for building kernel modules is kernel-devel : # yum install kernel kernel-devel . ....... ( The Redhat "kernel-headers" is the user space headers, see /usr/include/ ). Dec 10, 2021 at 11:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.