本文介绍: MacmacOS 13.3)中安装Ubuntu 22.04.3,Ubuntu的WiFi和WiFi 5G网络不可以使用,通过查找找到解决方案,记录下。

MacmacOS 13.3)中安装Ubuntu 22.04.3,Ubuntu的WiFi和WiFi 5G网络不可以使用,通过查找找到解决方案,记录下。

设备信息

MacmacOS 13.3
Ubuntu 22.04.3
网卡型号:Broadcom Inc. and subsidiaries BCM43602 802.11ac Wireless LAN SoC

1. Ubuntu WiFi不可用解决方式

因为Ubuntu的网卡驱动不可用导致的问题。

查看Mac的网卡型号

lspci | less # 搜索network controller
# 结果例如:Network controller: Broadcom Inc. and subsidiaries BCM43602 802.11ac Wireless LAN SoC

根据网卡型号搜索获取到的解决方法

sudo apt-get purge bcmwl-kernel-source
sudo apt update
sudo update-pciids
sudo apt install firmware-b43-installer
reboot

查看WiFi名字

使用ifconfig或者ip addr查看
在这里插入图片描述
然后执行命令

sudo iwconfig wlp3s0 txpower 10dBm #wlp3s0是刚查看的WiFi名字

问题

安装Ubuntu网卡驱动后,WiFi可以使用了,但是还有两个问题。
问题一:

sudo iwconfig wlp3s0 txpower 10dBm #wlp3s0是刚查看的WiFi名字

每次重启后失效,开机后都需要手动输入

问题二:
只有2.4G WiFi可以使用,5G WiFi不可以使用。

参考链接

https://zhuanlan.zhihu.com/p/60617749?utm_id=0
https://github.com/Dunedan/mbp-2016-linux

2. 解决WiFi重启后失效问题

iwconfig wlp3s0 txpower 10dBm命令添加root启动项中。

打开终端创建.sh脚本文

sudo touch /opt/captain.sh # 在/opt中创建captain.sh文件

编辑脚本文

gedit admin:///opt/captain.sh

复制粘贴脚本

iwconfig wlp3s0 txpower 10dBm #已经有root权限了,不再需要添加sudo

修改脚本权限

sudo chmod u+x /opt/captain.sh

创建并编辑systemd service文件

sudo touch /etc/systemd/system/captain.service
gedit admin:///etc/systemd/system/captain.service

复制粘贴下文到systemd service文件

[Unit]
Description=Captain service
After=network.target

[Service]
ExecStart=/opt/captain.sh

[Install]
WantedBy=multi-user.target

启动service

sudo systemctl start captain

设置service开机自启

sudo systemctl enable captain

重启即可

reboot

如何撤销上面的操作

顺序执行下面命令并重启即可撤销上面的操作。

sudo systemctl stop captain

sudo systemctl disable captain

sudo rm -v /opt/captain.sh

sudo rm -v /etc/systemd/system/captain.service

参考链接

https://gist.github.com/torresashjian/e97d954c7f1554b6a017f07d69a66374
https://easylinuxtipsproject.blogspot.com/p/root-command-startup.html

3. 解决 5G WiFi的问题

下载 brcmfmac43602-pcie.txt 文件

下载地址https://bugzilla.kernel.org/attachment.cgi?id=285753

修改文件中macaddr地址

使用 ifconfig 查看网卡信息,ether 字段值就是 macaddr,复制粘贴到brcmfmac43602-pcie.txt的macaddr中。

#需要替换的内容
macaddr=xx:xx:xx:xx:xx:xx

文件复制到/lib/firmware/brcm,然后重启

sudo cp brcmfmac43602-pcie.txt /lib/firmware/brcm
reboot

参考链接

https://github.com/Dunedan/mbp-2016-linux/issues/47

原文地址:https://blog.csdn.net/henglei1/article/details/134600026

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_1407.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注