Ubuntu20.04 有线网络图标消失解决方案
问题描述: ubuntu20.04系统提示的software updater有软件包更新,按提示安装更新软件包,重启系统后,ubuntu系统的网络图标消失不见;无法正常上网;检查网口,发现网卡上的灯也不亮;在系统Settings的Network项中,网络配置项也不见了,无法配置网络参数。
原因:这个是Ubuntu Network Manager Bug
解决方案:
sudo lshw -c Network
命令测试问题:
$ sudo lshw -c Network*-network:0 description: Wireless interfaceproduct: Cannon Point-LP CNVi [Wireless-AC]vendor: Intel Corporationphysical id: 14.3bus info: pci@0000:00:14.3logical name: wlp0s20f3version: 30serial: 38:00:25:9b:44:2awidth: 64 bitsclock: 33MHzcapabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wirelessconfiguration: broadcast=yes driver=iwlwifi driverversion=5.13.0-51-generic firmware=46.4d093a30.0 9000-pu-b0-jf-b0- ip=192.168.1.104 latency=0 link=yes multicast=yes wireless=IEEE 802.11resources: irq:16 memory:c9738000-c973bfff*-network:1 DISABLEDdescription: Ethernet interfaceproduct: Ethernet Connection (6) I219-Vvendor: Intel Corporationphysical id: 1f.6bus info: pci@0000:00:1f.6logical name: enp0s31f6version: 30serial: 98:fa:9b:12:3e:10capacity: 1Gbit/swidth: 32 bitsclock: 33MHzcapabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiationconfiguration: autonegotiation=on broadcast=yes driver=e1000e driverversion=5.13.0-51-generic firmware=0.5-3 latency=0 link=no multicast=yes port=twisted pairresources: irq:167 memory:c9700000-c971ffff*-network DISABLEDdescription: Ethernet interfacephysical id: 2bus info: usb@1:4logical name: enx00e04f0000ceserial: 00:e0:4f:00:00:cesize: 100Mbit/scapacity: 1Gbit/scapabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiationconfiguration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.12 duplex=full firmware=rtl8153a-4 v2 02/07/20 link=no multicast=yes port=MII speed=100Mbit/s
可见 Ethernet interface 状态为 DISABLE ,可以创建一个缺少的配置文件进而解决这个问题,具体操作如下:
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
sudo systemctl restart NetworkManager
之后,继续用lshw命令测试结果如下:
$ sudo lshw -c Network*-network:0 DISABLED description: Wireless interfaceproduct: Cannon Point-LP CNVi [Wireless-AC]vendor: Intel Corporationphysical id: 14.3bus info: pci@0000:00:14.3logical name: wlp0s20f3version: 30serial: 38:00:25:9b:44:2awidth: 64 bitsclock: 33MHzcapabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wirelessconfiguration: broadcast=yes driver=iwlwifi driverversion=5.13.0-51-generic firmware=46.4d093a30.0 9000-pu-b0-jf-b0- latency=0 link=no multicast=yes wireless=IEEE 802.11resources: irq:16 memory:c9738000-c973bfff*-network:1description: Ethernet interfaceproduct: Ethernet Connection (6) I219-Vvendor: Intel Corporationphysical id: 1f.6bus info: pci@0000:00:1f.6logical name: enp0s31f6version: 30serial: 98:fa:9b:12:3e:10capacity: 1Gbit/swidth: 32 bitsclock: 33MHzcapabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiationconfiguration: autonegotiation=on broadcast=yes driver=e1000e driverversion=5.13.0-51-generic firmware=0.5-3 latency=0 link=no multicast=yes port=twisted pairresources: irq:167 memory:c9700000-c971ffff*-networkdescription: Ethernet interfacephysical id: 2bus info: usb@1:4logical name: enx00e04f0000ceserial: 00:e0:4f:00:00:cesize: 100Mbit/scapacity: 1Gbit/scapabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiationconfiguration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.12 duplex=full firmware=rtl8153a-4 v2 02/07/20 ip=192.168.1.105 link=yes multicast=yes port=MII speed=100Mbit/s
可以看到physical id: 2的网卡已经恢复正常,同时网络图标也恢复正常可见。
以上是我的电脑网络修复的方案
其他方案参考:
在处理这个问题的过程中还看到有其他方案,但可能我电脑的状态不太一样,经过尝试并没有处理掉; 但如果有遇到网络图标消失的情况,也可进行尝试:
1、删除NetworkManager的缓存
$ sudo service NetworkManager stop $ sudo rm /var/lib/NetworkManager/NetworkManager.state $ sudo service NetworkManager start
2、修改配置,把其中的manage=false改为true
sudo vi /etc/NetworkManager/NetworkManager.conf
3、重启NetworkManager
sudo service NetworkManager restart
参考文章:https://blog.csdn.net/weixin_46721287/article/details/126098278