当我尝试连接到任何无线网络时,我得到:
无法添加/激活连接(32)... -1 未知
我已经有很多这样的答案,例如这个重建 PolicyKit 目录。这款 Ubuntu 14.04 LTS 超薄戴尔 XPS 没有以太网端口,因此调试起来并不容易,而且我无法运行系统更新,除非您有办法通过 USB 进行操作?
我的/etc/network/interfaces:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
另外,跑步sudo /etc/init.d/networking restart
说
停止:停止时作业失败 启动:作业已在运行:网络
我也尝试了所有这些,但没有成功:
sudo modprobe -r iwlwifi && sudo modprobe iwlwifi [until i run this i can see no network ssids]
sudo service network-manager restart
rfkill unblock all
sudo rm /etc/udev/rules.d/70-persistent-net.rules
sudo ifdown wlan0 && sudo ifup -v wlan0
上面最后一行产生了这个......
$sudo ifdown wlan0 && sudo ifup -v wlan0
ifdown: waiting for lock on /run/network/ifstate.wlan0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/88:53:2e:99:36:8f
Sending on LPF/wlan0/88:53:2e:99:36:8f
Sending on Socket/fallback
Configuring interface wlan0=wlan0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /var/run/wpa_supplicant
Starting /sbin/wpa_supplicant...
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
dhclient -1 -v -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/88:53:2e:99:36:8f
Sending on LPF/wlan0/88:53:2e:99:36:8f
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18 (xid=0x92ac315a)
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15 (xid=0x92ac315a)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/avahi-autoipd
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/ethtool
run-parts: executing /etc/network/if-up.d/ntpdate
run-parts: executing /etc/network/if-up.d/openvpn
run-parts: executing /etc/network/if-up.d/postfix
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
$
答案1
你的/etc/网络/接口文件有误。由于网络管理器正在运行,因此无需在该文件中声明 wlan0。请将其恢复为默认值:
auto lo
iface lo inet loopback
重新启动并让我们听取您的报告。
如果此方法无效,请仔细检查网络管理器中的所有设置。单击图标并选择编辑连接。确保您的 WiFi 连接设置为客户端模式。此外,检查 IPv4 设置下的方法是否设置为自动 (DHCP)。如果您进行了任何更改,请重新启动 NM:
sudo service network-manager restart
有什么改进吗?如果没有,让我们回到/etc/网络/接口.设置如下:
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <your_network_ssid>
wpa-psk <your_secret_key>
重启。你连接了吗?如果是,我接下来会编辑这个答案,建议你清除并重新安装网络管理器。
我们在您的日志中看到这一点:
如果不再使用“/var/run/wpa_supplicant/wlan0”,请手动删除它 12 月 13 日 16:48:20 eataylor-Dell-System-XPS-L321X wpa_supplicant[4530]: 无法初始化控制接口“/var/run/wpa_supplicant”。#012您可能有另一个 wpa_supplicant 进程正在运行,或者该文件是由于 wpa_supplicant 不干净终止而留下的,在这种情况下,您需要在再次启动 wpa_supplicant 之前手动删除此文件。
请执行以下操作:
sudo rm /var/run/wpa_supplicant/wlan0
重启。再次检查:
sudo ifdown wlan0 && sudo ifup -v wlan0
有改善吗?
这是我们在聊天中所采取的步骤的总结。
删除 /var/run/wpa_supplicant/wlan0 后,连接到手机热点,因为路由器似乎有点麻烦。然后执行以下操作:
sudo apt-get purge network-manager*
sudo apt-get install --reinstall wpasupplicant
sudo apt-get install network-manager network-manager-gnome
注释掉 wlan0 行/etc/网络/接口然后重启。您已成功连接。