我从亚马逊购买了 LOTEKOO USB 无线网络适配器,功能强大的 5dBi 天线 600Mbps 双频。我一直试图让它与我的 Ubuntu 配合使用:“Linux 4.15.0-34-generic #37~16.04.1-Ubuntu SMP Tue Aug 28 10:44:06 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux”。首先,我编译并安装了驱动程序GitHub 上的说明。但是当我插入 USB Dongle 时,它没有被检测到。查看系统日志:
Nov 3 14:50:23 pluto mtp-probe: bus: 3, device: 20 was not an MTP device
Nov 3 14:51:49 pluto kernel: [ 1795.291025] usb 3-4: USB disconnect, device number 20
Nov 3 14:51:51 pluto kernel: [ 1797.327114] usb 3-4: new high-speed USB device number 21 using xhci_hcd
Nov 3 14:51:52 pluto kernel: [ 1797.475703] usb 3-4: New USB device found, idVendor=0bda, idProduct=c811
Nov 3 14:51:52 pluto kernel: [ 1797.475709] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 3 14:51:52 pluto kernel: [ 1797.475712] usb 3-4: Product: 802.11ac NIC
Nov 3 14:51:52 pluto kernel: [ 1797.475715] usb 3-4: Manufacturer: Realtek
Nov 3 14:51:52 pluto kernel: [ 1797.475718] usb 3-4: SerialNumber: 123456
Nov 3 14:51:52 pluto mtp-probe: checking bus 3, device 21: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-4"
Nov 3 14:51:52 pluto mtp-probe: bus: 3, device: 21 was not an MTP device
Nov 3 14:51:52 pluto kernel: [ 1797.726714] usb 3-4: USB disconnect, device number 21
Nov 3 14:51:52 pluto kernel: [ 1798.035116] usb 3-4: new high-speed USB device number 22 using xhci_hcd
Nov 3 14:51:52 pluto kernel: [ 1798.183466] usb 3-4: New USB device found, idVendor=0bda, idProduct=c811
Nov 3 14:51:52 pluto kernel: [ 1798.183472] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Nov 3 14:51:52 pluto kernel: [ 1798.183475] usb 3-4: Product: 802.11ac NIC
Nov 3 14:51:52 pluto kernel: [ 1798.183479] usb 3-4: Manufacturer: Realtek
Nov 3 14:51:52 pluto kernel: [ 1798.183482] usb 3-4: SerialNumber: 123456
Nov 3 14:51:52 pluto mtp-probe: checking bus 3, device 22: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-4"
Nov 3 14:51:52 pluto mtp-probe: bus: 3, device: 22 was not an MTP device
按照一些说明,我创建了一个 udev 规则文件:
db2admin@pluto:/etc/udev/rules.d$ cat 90-myrules.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="c811", ATTRS{serial}=="123456"
当我查看输出时:
udevadm monitor --udev --property
UDEV [1662.908962] remove /devices/pci0000:00/0000:00:14.0/usb3/3-4 (usb)
ACTION=remove
BUSNUM=003
DEVNAME=/dev/bus/usb/003/019
DEVNUM=019
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-4
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=802.11ac_NIC
ID_MODEL_ENC=802.11ac\x20NIC
ID_MODEL_ID=c811
ID_REVISION=0200
ID_SERIAL=Realtek_802.11ac_NIC_123456
ID_SERIAL_SHORT=123456
ID_USB_INTERFACES=:ffffff:
ID_VENDOR=Realtek
ID_VENDOR_ENC=Realtek
ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Corp.
ID_VENDOR_ID=0bda
MAJOR=189
MINOR=274
PRODUCT=bda/c811/200
SEQNUM=7598
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=1648553212
UDEV [1710.433564] add /devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0 (usb)
.MM_USBIFNUM=00
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-4/3-4:1.0
DEVTYPE=usb_interface
ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Corp.
INTERFACE=255/255/255
MODALIAS=usb:v0BDApC811d0200dc00dsc00dp00icFFiscFFipFFin00
PRODUCT=bda/c811/200
SEQNUM=7619
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=1709427721
输出sudo lshw -C network
:
USB
*-network DISABLED
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:06:00.0
logical name: wlp6s0
version: 6b
serial: e8:b1:fc:50:1f:c7
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-34-generic firmware=17.608620.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
resources: irq:36 memory:f7900000-f7901fff
*-network
description: Wireless interface
physical id: 2
bus info: usb@3:3
logical name: wlx503eaa53e6ba
serial: 50:3e:aa:53:e6:ba
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=r8188eu ip=192.168.1.165 multicast=yes wireless=IEEE 802.11bgn
没有显示我的第三个网络设备,只显示我拥有并能工作的两个设备。
命令:
lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 8087:07dc Intel Corp.
Bus 003 Device 004: ID 06cb:0ac3 Synaptics, Inc.
Bus 003 Device 003: ID 0bda:c811 Realtek Semiconductor Corp.
Bus 003 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 003 Device 006: ID 0bda:573c Realtek Semiconductor Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
显示我的设备是 0bda:c811 Realtek Semiconductor Corp.,第二个 realtek 设备是另一个可以工作但不是 5G 的 USB Wifi。
sudo lshw -C network
*-network DISABLED
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:06:00.0
logical name: wlp6s0
version: 6b
serial: e8:b1:fc:50:1f:c7
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-34-generic firmware=17.608620.0 latency=0 link=no multicast=yes wireless=IEEE 802.11
resources: irq:36 memory:f7900000-f7901fff
*-network
description: Wireless interface
physical id: 2
bus info: usb@3:3
logical name: wlx503eaa53e6ba
serial: 50:3e:aa:53:e6:ba
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=r8188eu ip=192.168.1.165 multicast=yes wireless=IEEE 802.11bgn
我想知道我错过了什么。感谢您提供的任何帮助。
答案1
此答案应归功于 @chili555,他在上面的评论中给出了正确答案。对于其他可能对此感到困惑的人,以下是步骤:首先启用/安装 dkms。
sudo apt-get install dkms
下面是我遵循的命令序列:
sudo apt-get install dkms
cd Downloads/
git clone https://github.com/whitebatman2/rtl8821CU.git
cd rtl8821CU/
export DRV_NAME=rtl8821CU
export DRV_VERSION=5.2.5.3
set |grep DRV
sudo mkdir /usr/src/${DRV_NAME}-${DRV_VERSION}
git archive master | sudo tar -x -C /usr/src/${DRV_NAME}-${DRV_VERSION}
cd rtl8821CU/
git archive master | sudo tar -x -C /usr/src/${DRV_NAME}-${DRV_VERSION}
sudo dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms install -m ${DRV_NAME} -v ${DRV_VERSION}
答案2
更新了@chili555 和@Fabio 的答案(GitHub 的默认根从“master”更改为“main”)并删除了重复的行。
sudo apt-get install dkms
cd Downloads/
git clone https://github.com/whitebatman2/rtl8821CU.git
cd rtl8821CU
export DRV_NAME=rtl8821CU
export DRV_VERSION=5.2.5.3
set |grep DRV
sudo mkdir /usr/src/${DRV_NAME}-${DRV_VERSION}
git archive main | sudo tar -x -C /usr/src/${DRV_NAME}-${DRV_VERSION}
sudo dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms install -m ${DRV_NAME} -v ${DRV_VERSION}