# WiFi USB Realtek

**URL:** <https://forums.rockylinux.org/t/wifi-usb-realtek/15445>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [August 13, 2024, 5:42pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445 "2024-08-13T17:42:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 13, 2024, 5:42pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/1 "2024-08-13T17:42:47Z")

</div>

Error

[yani@maud rtl8723du]$ sudo dkms install rtl8723du/0.1  
[sudo] password for yani:  
Sign command: /lib/modules/5.14.0-427.28.1.el9\_4.x86\_64/build/scripts/sign-file  
Signing key: /var/lib/dkms/mok.key  
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:  
Cleaning build area…(bad exit status: 2)  
Failed command:  
make -C /lib/modules/5.14.0-427.28.1.el9\_4.x86\_64/build M=/var/lib/dkms/rtl8723du/0.1/build clean  
Building module(s)…(bad exit status: 2)  
Failed command:  
make -j64 KERNELRELEASE=5.14.0-427.28.1.el9\_4.x86\_64 -C /lib/modules/5.14.0-427.28.1.el9\_4.x86\_64/build M=/var/lib/dkms/rtl8723du/0.1/build  
Error! Bad return status for module build on kernel: 5.14.0-427.28.1.el9\_4.x86\_64 (x86\_64)  
Consult /var/lib/dkms/rtl8723du/0.1/build/make.log for more information.

Using these instructions with apt \> dnf

I’m assuming this is Linux 9 compatibility issue.

This is the device I’m trying to install…

Bus 001 Device 002: ID 0bda:d723 Realtek Semiconductor Corp. 802.11n WLAN Adapter

Any clues?

Yani

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [August 13, 2024, 6:09pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/2 "2024-08-13T18:09:07Z")

</div>

Did you inspect `/var/lib/dkms/rtl8723du/0.1/build/make.log`? Can you share the contents of this file?

---

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 13, 2024, 7:43pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/3 "2024-08-13T19:43:04Z")

</div>

DKMS make.log for rtl8723du-0.1 for kernel 5.14.0-427.28.1.el9\_4.x86\_64 (x86\_64)  
Wed 14 Aug 2024 03:37:06 AEST  
make: Entering directory ‘/usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64’  
echo “WARNING: This driver is obsolete. Use [GitHub - lwfinger/rtw88: A backport of the Realtek Wifi 5 drivers from the wireless-next repo.](http://github.com/lwfinger/rtw88.git) instead”  
/var/lib/dkms/rtl8723du/0.1/build/Makefile:68: /usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64/hal/phydm/phydm.mk: No such file or d\>  
make[1]: \*\*\* No rule to make target ‘/usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64/hal/phydm/phydm.mk’. Stop.  
make: \*\*\* [Makefile:1936: /var/lib/dkms/rtl8723du/0.1/build] Error 2  
make: Leaving directory ‘/usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64’

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [August 13, 2024, 8:07pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/4 "2024-08-13T20:07:12Z")

</div>

It looks like you should follow the link and try to build that module.

---

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 14, 2024, 12:02pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/5 "2024-08-14T12:02:44Z")

</div>

Yes it does… I run into issues with not knowing all differences between this and that Linux. I think the default install directory is wrong for RHEL.

A further issue is I have instruction that pull needed detail lspci but lsusb doesn’t probe deep enough to give the chipset.

This might be the best run down of the issues…

> **[GitHub - morrownr/USB-WiFi: USB WiFi Adapter Information for Linux](https://github.com/morrownr/USB-WiFi?tab=readme-ov-file)**
>
> USB WiFi Adapter Information for Linux

I’ve got as far as this…

[yani@maud rtl8192cu]$ ls  
core dkms.conf hal include Makefile os\_dep README.md  
[yani@maud rtl8192cu]$ sudo make  
[sudo] password for yani:  
make ARCH=x86\_64 CROSS\_COMPILE= -C /lib/modules/5.14.0-427.28.1.el9\_4.x86\_64/build M=/home/yani/wifi/rtl8192cu modules  
make[1]: Entering directory ‘/usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64’  
CC [M] /home/yani/wifi/rtl8192cu/core/rtw\_cmd.o  
In file included from /home/yani/wifi/rtl8192cu/core/rtw\_cmd.c:23:  
/home/yani/wifi/rtl8192cu/core/rtw\_cmd.c: In function ‘rtw\_cmd\_thread’:  
/home/yani/wifi/rtl8192cu/include/osdep\_service.h:857:31: error: implicit declaration of function ‘complete\_and\_exit’ [-Werror=implicit-function-declaration]  
857 | #define thread\_exit() complete\_and\_exit(NULL, 0)  
| ^ ~~~~~~~~~~~~~~~~  
/home/yani/wifi/rtl8192cu/core/rtw\_cmd.c:570:9: note: in expansion of macro ‘thread\_exit’  
570 | thread\_exit();  
| ^ ~~~~~~~~~~  
/home/yani/wifi/rtl8192cu/core/rtw\_cmd.c:572:1: error: control reaches end of non-void function [-Werror=return-type]  
572 | }  
| ^  
cc1: some warnings being treated as errors  
make[2]: \*\*\* [scripts/Makefile.build:299: /home/yani/wifi/rtl8192cu/core/rtw\_cmd.o] Error 1  
make[1]: \*\*\* [Makefile:1936: /home/yani/wifi/rtl8192cu] Error 2  
make[1]: Leaving directory ‘/usr/src/kernels/5.14.0-427.28.1.el9\_4.x86\_64’  
make: \*\*\* [Makefile:569: modules] Error 2

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [August 14, 2024, 12:23pm UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/6 "2024-08-14T12:23:24Z")

</div>

I mean this snippet from your log file:  
_echo “WARNING: This driver is obsolete. Use [GitHub - lwfinger/rtw88: A backport of the Realtek Wifi 5 drivers from the wireless-next repo.](http://github.com/lwfinger/rtw88.git) instead”_

You try to build the module `rtl8722du` and the message says you should use the module `rtw88` instead. It also offers support for the `rtl8722du`.  
Follow the manual for `Fedora` and `Basic Install for all Distros`. If you can build it, than you can configure `DKMS` to rebuild it automatically every time a new `kernel` drops.

---

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 15, 2024, 2:40am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/7 "2024-08-15T02:40:31Z")

</div>

I have followed the redirect…

I think I’m a give away the dongle and get one with a mediatek chipset.

This is where I think it is going wrong…

```auto
install -p -m 644 rtl8192cu.ko /lib/modules/5.14.0-427.28.1.el9_4.x86_64/kernel/drivers/net/wireless/
install: cannot stat 'rtl8192cu.ko': No such file or directory
make: *** [Makefile:575: install] Error 1

```

Actual structure of dir

```auto
[yani@maud wireless]$ ls
ath broadcom intel marvell mediatek ralink realtek virtual
[yani@maud wireless]$ cd realtek
[yani@maud realtek]$ ls
rtl8xxxu rtlwifi rtw88 rtw89
[yani@maud realtek]$

```

It’s likely I don’t know enough about make to see obvious mistakes.

Do I have to clear something or delete something before I run it a second time?

---

<div class="post-metadata">

**Author:** ![toracat](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/toracat/32/68_2.png) [@toracat](https://forums.rockylinux.org/u/toracat)\
**Post date:** [August 15, 2024, 3:05am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/8 "2024-08-15T03:05:35Z")

</div>

Can you run ‘lsusb’ and find the deviceIDs in the form of [xxxx:yyyy] ? Then you can see if that devide is supported by ELRepo’s kmod-rtw88\_usb package. Look in:

[https://elrepo.org/wiki/doku.php?id=deviceids#kmod-rtw88\_usb](https://elrepo.org/wiki/doku.php?id=deviceids#kmod-rtw88_usb)

---

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 15, 2024, 8:37am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/9 "2024-08-15T08:37:25Z")

</div>

Did that to a different list.

0BDA:D723 (rtw88\_8723du)

The driver I was using was I think correct but I found another here…

> **[GitHub - kimocoder/rtw88-usb: 8723d 8821c 8822bu 8812bu 8822cu 8812cu linux...](https://github.com/kimocoder/rtw88-usb)**
>
> 8723d 8821c 8822bu 8812bu 8822cu 8812cu linux mac80211 driver

```auto
make -C /lib/modules/5.14.0-427.28.1.el9_4.x86_64/build M=/home/yani/wifi/rtw88-usb
make[1]: Entering directory '/usr/src/kernels/5.14.0-427.28.1.el9_4.x86_64'
  CC [M] /home/yani/wifi/rtw88-usb/main.o
/home/yani/wifi/rtw88-usb/main.c: In function ‘rtw_vif_watch_dog_iter’:
/home/yani/wifi/rtw88-usb/main.c:166:34: error: ‘struct ieee80211_bss_conf’ has no member named ‘assoc’
  166 | if (vif->bss_conf.assoc)
      | ^
/home/yani/wifi/rtw88-usb/main.c: In function ‘rtw_vif_assoc_changed’:
/home/yani/wifi/rtw88-usb/main.c:507:25: error: ‘struct ieee80211_bss_conf’ has no member named ‘assoc’
  507 | if (conf && conf->assoc) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:508:35: error: ‘struct ieee80211_bss_conf’ has no member named ‘aid’
  508 | rtwvif->aid = conf->aid;
      | ^~
In file included from ./include/linux/byteorder/little_endian.h:5,
                 from ./arch/x86/include/uapi/asm/byteorder.h:5,
                 from ./include/asm-generic/qrwlock_types.h:6,
                 from ./arch/x86/include/asm/spinlock_types.h:7,
                 from ./include/linux/spinlock_types_raw.h:7,
                 from ./include/linux/ratelimit_types.h:7,
                 from ./include/linux/ratelimit.h:5,
                 from ./include/linux/dev_printk.h:16,
                 from ./include/linux/device.h:15,
                 from ./include/linux/devcoredump.h:8,
                 from /home/yani/wifi/rtw88-usb/main.c:5:
/home/yani/wifi/rtw88-usb/main.c: In function ‘get_vht_ra_mask’:
/home/yani/wifi/rtw88-usb/main.c:852:38: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
  852 | u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
      | ^~
./include/uapi/linux/byteorder/little_endian.h:37:51: note: in definition of macro ‘__le16_to_cpu’
   37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
      | ^
/home/yani/wifi/rtw88-usb/main.c:852:23: note: in expansion of macro ‘le16_to_cpu’
  852 | u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
      | ^ ~~~~~~~~~~
/home/yani/wifi/rtw88-usb/main.c: In function ‘rtw_update_sta_info’:
/home/yani/wifi/rtw88-usb/main.c:1055:16: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1055 | if (sta->vht_cap.vht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1058:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1058 | if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_MASK)
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1060:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1060 | if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1062:23: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1062 | } else if (sta->ht_cap.ht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1063:32: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1063 | ra_mask |= (sta->ht_cap.mcs.rx_mask[1] << 20) |
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1064:32: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1064 | (sta->ht_cap.mcs.rx_mask[0] << 12);
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1065:24: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1065 | if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1067:24: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1067 | if (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1075:36: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’
 1075 | ra_mask |= (u64)sta->supp_rates[NL80211_BAND_5GHZ] << 4;
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1076:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1076 | if (sta->vht_cap.vht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1079:31: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1079 | } else if (sta->ht_cap.ht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1087:31: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’
 1087 | ra_mask |= sta->supp_rates[NL80211_BAND_2GHZ];
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1088:24: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1088 | if (sta->vht_cap.vht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1093:31: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1093 | } else if (sta->ht_cap.ht_supported) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1098:31: error: ‘struct ieee80211_sta’ has no member named ‘supp_rates’
 1098 | } else if (sta->supp_rates[0] <= 0xf) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1109:20: error: ‘struct ieee80211_sta’ has no member named ‘bandwidth’
 1109 | switch (sta->bandwidth) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1112:37: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1112 | is_support_sgi = sta->vht_cap.vht_supported &&
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1113:38: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1113 | (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80);
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1117:37: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1117 | is_support_sgi = sta->ht_cap.ht_supported &&
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1118:38: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1118 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40);
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1122:37: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1122 | is_support_sgi = sta->ht_cap.ht_supported &&
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1123:38: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1123 | (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20);
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1127:16: error: ‘struct ieee80211_sta’ has no member named ‘vht_cap’
 1127 | if (sta->vht_cap.vht_supported && ra_mask & 0xffc00000) {
      | ^~
/home/yani/wifi/rtw88-usb/main.c:1130:23: error: ‘struct ieee80211_sta’ has no member named ‘ht_cap’
 1130 | } else if (sta->ht_cap.ht_supported && ra_mask & 0xfff00000) {
      | ^~
make[2]: *** [scripts/Makefile.build:299: /home/yani/wifi/rtw88-usb/main.o] Error 1
make[1]: *** [Makefile:1936: /home/yani/wifi/rtw88-usb] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.14.0-427.28.1.el9_4.x86_64'
make: *** [Makefile:114: all] Error 2
[yani@maud rtw88-usb]$ sudo make install
[sudo] password for yani: 
WARNING:
==========================================
you are about to install rtw88-usb drivers
Wait 5 sec or CTRL-C
cp: cannot stat '*.ko': No such file or directory
make: *** [Makefile:147: install] Error 1

```

If I did get this install how does it manifest?

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [August 15, 2024, 10:41am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/10 "2024-08-15T10:41:28Z")

</div>

> [@toracat](#):
>
> kmod-rtw88\_usb

You don’t have to build the module yourself, @toracat gave you the solution.  
The right driver is packaged in `elrepo`. Execute the following commands to install the module:

```bash
user@rocky:~$ sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
user@rocky:~$ sudo dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
user@rocky:~$ sudo dnf install --enablerepo=elrepo kmod-rtw88_usb

```

---

<div class="post-metadata">

**Author:** ![Yani](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@Yani](https://forums.rockylinux.org/u/Yani)\
**Post date:** [August 15, 2024, 11:33am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/11 "2024-08-15T11:33:40Z")

</div>

Brilliant! Worked perfectly and enabled a wifi connection in the toolbar.

Hope it helps the next person.

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [August 15, 2024, 11:42am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/12 "2024-08-15T11:42:42Z")

</div>

Great! Please mark the @toracat post as the solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [October 14, 2024, 11:43am UTC](https://forums.rockylinux.org/t/wifi-usb-realtek/15445/13 "2024-10-14T11:43:01Z")

</div>

Closed on October 14, 2024, 11:43am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
