Realtek Wifi 无法在 Xubuntu 18.04 LTS 上运行

Realtek Wifi 无法在 Xubuntu 18.04 LTS 上运行

我刚刚安装了最新的Xubuntu 18.04 LTS在我新买的低配置笔记本电脑上,同时安装了 Windows 10(双启动)。安装的所有功能都运行良好,但 Wifi 无法使用。有时(很少)我可以连接到我的 wifi 路由器,但网络信号太弱。我的笔记本电脑使用realtek 驱动程序(可能是 RTL8723BU) 的 wifi。它在 Windows 10 系统中运行良好。从 inxi -Fxz 命令我发现我的网卡不知为何没有安装。在 Xumuntu 我现在完全没有互联网。在这里我想补充一点,这台笔记本电脑没有有线局域网选项。

我该如何修复/解决这个 wifi/网卡问题?

以下是输出英希-Fxz

boundule@BUDDY:~$ inxi -Fxz
System:    Host: BUDDY Kernel: 4.15.0-30-generic x86_64 bits: 64 gcc: 7.3.0 Desktop: Xfce 4.12.3 (Gtk 2.24.31)
           Distro: Ubuntu 18.04.1 LTS
Machine:   Device: laptop System: Walton product: Prelude R1 serial: N/A
           Mobo: N/A model: N/A serial: N/A
           UEFI: American Megatrends v: WH-BI-14-Y116AR120-105-C date: 03/13/2018
CPU:       Dual core Intel Celeron N3350 (-MCP-) arch: N/A cache: 1024 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 4377
           clock speeds: max: 2400 MHz 1: 869 MHz 2: 861 MHz
Graphics:  Card: Intel Device 5a85 bus-ID: 00:02.0
           Display Server: x11 (X.Org 1.19.6 ) drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: [email protected]
           OpenGL: renderer: Mesa DRI Intel HD Graphics 500 (Broxton 2x6)
           version: 4.5 Mesa 18.0.5 Direct Render: Yes
Audio:     Card Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
           driver: snd_hda_intel bus-ID: 00:0e.0
           Sound: Advanced Linux Sound Architecture v: k4.15.0-30-generic
Network:   Card: Failed to Detect Network Card!
Drives:    HDD Total Size: 1008.2GB (1.2% used)
           ID-1: /dev/sda model: HGST_HTS541010B7 size: 1000.2GB
           ID-2: USB /dev/sdb model: Transcend_8GB size: 8.0GB
Partition: ID-1: / size: 19G used: 4.6G (27%) fs: ext4 dev: /dev/sda7
           ID-2: /home size: 35G used: 51M (1%) fs: ext4 dev: /dev/sda9
           ID-3: swap-1 size: 6.14GB used: 0.00GB (0%) fs: swap dev: /dev/sda8
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 49.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 166 Uptime: 37 min Memory: 397.8/3778.5MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 

以下是输出lspci;lsusb

00:00.0 Host bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge (rev 0b)
00:00.1 Signal processing controller: Intel Corporation Device 5a8c (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Device 5a85 (rev 0b)
00:0e.0 Audio device: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster (rev 0b)
00:0f.0 Communication controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine (rev 0b)
00:12.0 SATA controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller (rev 0b)
00:15.0 USB controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI (rev 0b)
00:16.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 (rev 0b)
00:16.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 (rev 0b)
00:16.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 (rev 0b)
00:16.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 (rev 0b)
00:17.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 (rev 0b)
00:17.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 (rev 0b)
00:17.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 (rev 0b)
00:17.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 (rev 0b)
00:18.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 (rev 0b)
00:18.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 (rev 0b)
00:18.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 (rev 0b)
00:18.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 (rev 0b)
00:19.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 (rev 0b)
00:19.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 (rev 0b)
00:19.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 (rev 0b)
00:1c.0 SD Host controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller (rev 0b)
00:1f.0 ISA bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface (rev 0b)
00:1f.1 SMBus: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller (rev 0b)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 058f:5608 Alcor Micro Corp. 
Bus 001 Device 004: ID 0bda:b720 Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 09da:c10a A4Tech Co., Ltd. 
Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 006: ID 058f:6387 Alcor Micro Corp. Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

以下是输出usb 设备 | awk '/b720/' RS=

T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=  4 Spd=480 MxCh= 0
D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0bda ProdID=b720 Rev=02.00
S:  Manufacturer=Realtek
S:  Product=802.11n WLAN Adapter
S:  SerialNumber=00e04c000001
C:  #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 2 Alt= 0 #EPs= 6 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8xxxu

运行命令并重新启动后问题仍然存在。

boundule@BUDDY:~$ sudo apt install build-essential dkms
[sudo] password for boundule: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
Suggested packages:
  menu
The following packages will be upgraded:
  dkms
1 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
Need to get 68.0 kB of archives.
After this operation, 19.5 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://bd.archive.ubuntu.com/ubuntu bionic-updates/main amd64 dkms all 2.3-3ubuntu9.2 [68.0 kB]
Fetched 68.0 kB in 3s (19.6 kB/s)
(Reading database ... 185574 files and directories currently installed.)
Preparing to unpack .../dkms_2.3-3ubuntu9.2_all.deb ...
Unpacking dkms (2.3-3ubuntu9.2) over (2.2.0.3-2ubuntu11) ...
Setting up dkms (2.3-3ubuntu9.2) ...
Installing new version of config file /etc/dkms/framework.conf ...
Installing new version of config file /etc/dkms/template-dkms-mkdeb/debian/control ...
Installing new version of config file /etc/kernel/prerm.d/dkms ...
Processing triggers for man-db (2.8.3-2) ...
boundule@BUDDY:~$ git clone https://github.com/lwfinger/rtl8723bu.git
Cloning into 'rtl8723bu'...
remote: Counting objects: 2438, done.
remote: Total 2438 (delta 0), reused 0 (delta 0), pack-reused 2438
Receiving objects: 100% (2438/2438), 7.41 MiB | 63.00 KiB/s, done.
Resolving deltas: 100% (1960/1960), done.
boundule@BUDDY:~$ cd rtl8723bu
boundule@BUDDY:~/rtl8723bu$ source dkms.conf
boundule@BUDDY:~/rtl8723bu$ sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
boundule@BUDDY:~/rtl8723bu$ sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
boundule@BUDDY:~/rtl8723bu$ sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION

Creating symlink /var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/source ->
                 /usr/src/rtl8723bu-4.3.6.11_12942.20141204_BTCOEX20140507-4E40

DKMS: add completed.
boundule@BUDDY:~/rtl8723bu$ sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=4.15.0-30-generic -C /lib/modules/4.15.0-30-generic/build M=/var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/build..........................
Signing module:
Generating a new Secure Boot signing key:
Generating a 2048 bit RSA private key
...............................................+++
...........+++
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
-----
 - /var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/4.15.0-30-generic/x86_64/module/rtl8723bu.ko
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.

rtl8723bu.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/

depmod......

DKMS: install completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j2 KERNELRELEASE=4.15.0-30-generic -C /lib/modules/4.15.0-30-generic/build M=/var/lib/dkms/rtlwifi-new/0.10/build....(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/rtlwifi-new-dkms.0.crash'
Error! Bad return status for module build on kernel: 4.15.0-30-generic (x86_64)
Consult /var/lib/dkms/rtlwifi-new/0.10/build/make.log for more information.
boundule@BUDDY:~/rtl8723bu$ 

答案1

您的设备使用驱动程序 8723bu。它必须从源代码编译。通过以太网、网络共享或任何可能的方式建立有效的互联网连接,打开终端并执行以下操作:

sudo apt install build-essential dkms
git clone https://github.com/lwfinger/rtl8723bu.git
cd rtl8723bu
source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

重新启动。如果启用了安全启动,则必须禁用它才能加载内核外模块。

编辑:通常,信号弱是由于天线连接到卡上的连接 #1,而默认驱动程序期望在连接 #2 处看到信号。当然,您可以打开笔记本电脑并切换电线,或者您可以添加允许在驱动程序级别选择天线的驱动程序参数。

sudo -i
echo “options 8723bu rtw_ant_num=1”  >  /etc/modprobe.d/8723bu.conf
exit

重启。

如果此方法无效,请使用 rtw_ant_num=2 重复此过程。重新启动。

编辑2:我们看到您首选的路由器设置为使用 TKIP 加密以及 WPA 和 WPA2 混合模式。请更改路由器中的设置。

首选 WPA2-AES;而不是任何 WPA 和 WPA2 混合模式,当然也不是 TKIP。其次,如果您的路由器支持 N 速度,那么使用 2.4 GHz 频段的 20 MHz 信道宽度(而不是自动 20/40 MHz)可能会获得更好的连接性,尽管它可能会影响 N 速度。使用固定信道(1、6 或 11)比自动信道选择更幸运。此外,请确保路由器未设置为仅使用 N 速度;首选自动 B、G 和 N。进行这些更改后,重新启动路由器。

接下来,我建议明确设置你的监管范围。检查你的:

sudo iw reg get

如果您选择 00,则这是一个通用的设置。请在此处查找您的设置:http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2然后暂时设置一下:

sudo iw reg set IS

当然,如果不是冰岛,请替换您的国家代码。永久设置它:

sudo nano /etc/default/crda

将最后一行改为:

REGDOMAIN=IS

仔细校对,保存并关闭文本编辑器。

接下来,让我们尝试驱动程序中可能有用的每一个设置并进行测试:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=2

现在测试:

sudo iwlist scan

您的首选路由器现在是否性能更佳?如果没有,请尝试:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=3

现在测试:

sudo iwlist scan

您的首选路由器现在是否性能更佳?如果没有,请尝试:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=1

...这是您设置的原始设置。

如果这些步骤都没有用,我建议您在这里向驱动程序作者提出问题:https://github.com/lwfinger/rtl8723bu/issues

编辑3:我们将对 Makefile 进行修改。首先,我们需要删除模块;接下来,更改 Makefile,最后重建。

从终端:

sudo dkms remove rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40 --all

现在导航到您 git 克隆驱动程序的位置;也许是您的主目录:

cd ~/rtl8723bu
git pull
nano Makefile

转到第 21 行并更改此行:

EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

要将其注释掉,就像这样:

#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

仔细校对两遍。保存(Ctrl+o 然后按 Enter)并退出(Ctrl+x)文本编辑器。

现在重建并安装驱动程序:

source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

重新启动并告诉我们是否有任何改进。

答案2

在 chili555 和其他不同来源的帮助下进行深入分析后,我的问题通过以下方式解决:

第一步:

sudo apt install build-essential dkms
sudo apt install git
git clone https://github.com/lwfinger/rtl8723bu.git
sudo apt install libelf-dev

第二步:

sudo -i
echo blacklist rtl8xxxu >> /etc/modprobe.d/blacklist.conf
exit

这确保了旧驱动程序不会用于我的设备。在我的情况下,有问题的驱动程序是 rtl8xxxu。所以我把它列入了黑名单。

第三步: 现在我禁用了新驱动程序的 makefile 中的一行,因为如果没有这个 hack,网络管理器中就会显示无线芯片组的两个实例(就像 chili555 的编辑 3 一样)

cd rtl8723bu
nano Makefile

转到第 21 行并更改此行:

EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

要将其注释掉,就像这样:

#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

保存(Ctrl+o 然后按 Enter)并退出(Ctrl+x)文本编辑器。

第四步: 现在构建并安装驱动程序:

source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

第五步: 最后,使用以下命令安装编译后的模块:

make
sudo make install

重新启动计算机。

相关内容