
一、先用lsusb查看usb设备:
#lsusbBus 003 Device 003: ID 0bda:b82c Realtek Semiconductor Corp. 802.11ac NIC
二、根据usb id “0bda:b82c”搜索
https://linux-hardware.org/?id=usb:0bda-b82c

三、搜索Ubuntu(Debian) 8822BU 驱动安装
[Linux]Ubuntu22.04下8822BU、8812BU无线网卡驱动安装教程 - 知乎
https://zhuanlan.zhihu.com/p/636513768
参考来源:https://github.com/morrownr/88x2bu-20210702
四、下载驱动源码
sudo apt update && sudo apt upgrade
sudo apt install -y linux-headers-$(uname -r) build-essential bc dkms git libelf-dev rfkill iw
git clone https://github.com/morrownr/88x2bu-20210702
cd 88x2bu-20210702
sudo ./install-driver.sh
Sign command: /lib/modules/6.6.38-trim/build/scripts/sign-file
Binary /lib/modules/6.6.38-trim/build/scripts/sign-file not found, modules won't be signed
Error! Your kernel headers for kernel 6.6.38-trim cannot be found at /lib/modules/6.6.38-trim/build or /lib/modules/6.6.38-trim/source.
Please install the linux-headers-6.6.38-trim package or use the --kernelsourcedir option to tell DKMS where it's located.
An error occurred. dkms build error: 1
Please report this error.
Please copy all screen output and paste it into the problem report.
Run the following before reattempting installation.
$
sudo ./remove-driver.sh
五、解决/lib/modules/6.6.38-trim/build软链接错误
这个问题可能不一定会遇到,根据飞牛论坛 螃蟹8852be 驱动安装成功 - 硬件讨论 飞牛私有云论坛 fnOS
https://club.fnnas.com/forum.php?mod=viewthread&tid=7266

提到重新安装系统可以解决。但重装系统有成本,这里列出另外一种方案。
下载kernel 6.6.38 source
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.38.tar.xz
tar -xf linux-6.6.38.tar.xz
cd linux-6.6.38
拷贝系统kernel config
cp /boot/config-$(uname -r) .config
sudo apt install libncurses-dev
make olddefconfig
编译kernel module
make modules_prepare
make modules -j4 (可能不是必须的,编译所有module,比较耗时,可以跳过,如果后面编译网卡驱动报错再来执行)
建立软连接
rm /lib/modules/6.6.38-trim/build
sudo ln -s ~/linux-6.6.38 /lib/modules/6.6.38-trim/build
编译驱动
cd 88x2bu-20210702
sudo ./install-driver.sh
: ---------------------------
: install-driver.sh v20241003
: x86_64 (kernel architecture)
: x86_64 (architecture to send to gcc)
: 4/4 (in-use/total processing units)
: 8016856 (total system memory)
: 6.6.38-trim (kernel version)
: gcc (version of gcc used to compile the kernel)
: gcc (Debian 12.2.0-14) 12.2.0
: dkms-3.0.10
: SecureBoot disabled
: ---------------------------
Checking for previously installed drivers...
Removing a driver that was added to dkms.
Deleting module rtl88x2bu-5.13.1 completely from the DKMS tree.
Removing 88x2bu.conf from /etc/modprobe.d
Removing source files from /usr/src/rtl88x2bu-5.13.1
Finished checking for and uninstalling previously installed drivers.
: ---------------------------
Starting installation.
Copying 88x2bu.conf to /etc/modprobe.d
The dkms installation routines are in use.
Copying source files to /usr/src/rtl88x2bu-5.13.1
Creating symlink /var/lib/dkms/rtl88x2bu/5.13.1/source -> /usr/src/rtl88x2bu-5.13.1
The driver was added to dkms successfully.
: ---------------------------
Sign command: /lib/modules/6.6.38-trim/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Building module:
Cleaning build area...
kernelver=6.6.38-trim ./dkms-make.sh.................
Signing module /var/lib/dkms/rtl88x2bu/5.13.1/build/88x2bu.ko
Cleaning build area...
The driver was built by dkms successfully.
: ---------------------------
88x2bu.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.6.38-trim/updates/dkms/
depmod...
The driver was installed by dkms successfully.
: ---------------------------
Info: Update this driver with the following commands as needed:
$
git pull
$
sudo sh install-driver.sh
Note: Updates to this driver SHOULD be performed before distro
upgrades such as Ubuntu 23.10 to 24.04.
Note: Updates to this driver SHOULD be performed before major
upgrades such as kernel 6.5 to 6.6.
Note: Updates can be performed as often as you like. It is
recommended to update at least every 3 months.
Note: Work on this driver, like the Linux kernel, is continuous.
Enjoy!
Unable to run $ rfkill unblock wlan
Do you want to edit the driver options file now? (recommended) [Y/n] n
Do you want to apply the new options by rebooting now? (recommended) [Y/n] y
参考文章:
https://zhuanlan.zhihu.com/p/636513768
[Linux]Ubuntu22.04下8822BU、8812BU无线网卡驱动安装教程 - 知乎
https://github.com/morrownr/88x2bu-20210702
morrownr/88x2bu-20210702: Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU
https://club.fnnas.com/forum.php?mod=viewthread&tid=7266
螃蟹8852be 驱动安装成功 - 硬件讨论 飞牛私有云论坛 fnOS
https://1023.org.cn/p/aa899d5fb8
飞牛系统FNOS添加NTFS3模块并挂载NTFS分区 | 遇见时光-1023.org.cn