文章目錄
- 設備信息
- 1. Ubuntu WiFi不可用解決方式
- 查看Mac的網卡型號
- 根據網卡型號搜索獲取到的解決方法
- 查看WiFi名字
- 問題
- 參考鏈接
- 2. 解決WiFi重啟后失效問題
- 打開終端創建.sh腳本文件
- 編輯腳本文件
- 復制粘貼腳本
- 修改腳本權限
- 創建并編輯systemd service文件
- 復制粘貼下文到systemd service文件
- 啟動service
- 設置service開機自啟
- 重啟即可
- 如何撤銷上面的操作
- 參考鏈接
- 3. 解決 5G WiFi的問題
- 下載 brcmfmac43602-pcie.txt 文件
- 修改文件中macaddr地址
- 把文件復制到/lib/firmware/brcm,然后重啟
- 參考鏈接
Mac(macOS 13.3)中安裝Ubuntu 22.04.3,Ubuntu的WiFi和WiFi 5G網絡不可以使用,通過查找找到解決方案,記錄下。
設備信息
Mac:macOS 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 captainsudo systemctl disable captainsudo rm -v /opt/captain.shsudo 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