![Ubuntu 16.04 重启后无 WiFi 或启用 WiFi 选项](https://linux22.com/image/882692/Ubuntu%2016.04%20%E9%87%8D%E5%90%AF%E5%90%8E%E6%97%A0%20WiFi%20%E6%88%96%E5%90%AF%E7%94%A8%20WiFi%20%E9%80%89%E9%A1%B9.png)
请帮我解决笔记本电脑的 WiFi 问题。我有一台运行 Ubuntu 16.04 LTS 的 Dell XPS L521X。我的 WiFi 卡英特尔双频无线-AC 7260。我的 WiFi 可以正常工作,但在随机冷启动或重启时,WiFi 不工作(空心 WiFi 图标且没有可用的启用 WiFi 选项)。
运行后sudo service network-manager restart
它又可以工作了,但我不想每次重启电脑时都这么做。有什么办法可以解决这个问题吗?
为了以防万一,以下是我运行一些命令检查状态时得到的结果:
han@XPS:~$ dmesg | grep iwl
[ 3.714166] iwlwifi 0000:08:00.0: Direct firmware load for iwlwifi-7260-17.ucode failed with error -2
[ 3.716989] iwlwifi 0000:08:00.0: loaded firmware version 16.242414.0 op_mode iwlmvm
[ 3.753941] iwlwifi 0000:08:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144
[ 3.754221] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
[ 3.754835] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
[ 3.977124] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[ 3.978658] iwlwifi 0000:08:00.0 wlp8s0: renamed from wlan0
[ 4.192308] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
[ 4.192568] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
[ 4.394290] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
[ 4.394697] iwlwifi 0000:08:00.0: L1 Enabled - LTR Disabled
han@XPS:~$ modinfo iwlwifi | grep 7260
firmware: iwlwifi-7260-13.ucode
han@XPS:~$ sudo lshw -c network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:07:00.0
logical name: enp7s0
version: 07
serial: f0:1f:af:32:ce:79
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168e-3_0.0.4 03/27/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:29 ioport:2000(size=256) memory:d2404000-d2404fff memory:d2400000-d2403fff
*-network
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:08:00.0
logical name: wlp8s0
version: 73
serial: 7c:5c:f8:68:e7:e6
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.4.0-22-generic firmware=16.242414.0 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn
resources: irq:34 memory:d2600000-d2601fff
han@XPS:~$ sudo service network-manager restart
han@XPS:~$ sudo lshw -c network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:07:00.0
logical name: enp7s0
version: 07
serial: f0:1f:af:32:ce:79
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168e-3_0.0.4 03/27/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:29 ioport:2000(size=256) memory:d2404000-d2404fff memory:d2400000-d2403fff
*-network
description: Wireless interface
product: Wireless 7260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:08:00.0
logical name: wlp8s0
version: 73
serial: 7c:5c:f8:68:e7:e6
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.4.0-22-generic firmware=16.242414.0 ip=192.168.1.9 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
resources: irq:34 memory:d2600000-d2601fff
提前致谢!
答案1
~/.bashrc
这里有一个快速的黑客方法来达到你想要的结果。用文本编辑器打开你的文件,滚动到底部并添加行echo "your_password" | sudo service network-manager restart
。每次打开电脑时,它都会自动运行。但有一个不好的副作用是,每次打开新的终端窗口时它也会运行。另一个更优雅的选择是把它放在一个脚本中,比如这个所以它仅在启动时运行。