问题如上。
解决方法:
-
先关掉NetworkManager:
sudo service NetworkManager stop
-
用gedit打开NetworkManager.state
sudo gedit /var/lib/NetworkManager/NetworkManager.state
-
改成如下:
-
重启NetworkManager:
sudo service NetworkManager restart
-
完成
- 注意:不同版本的Ubuntu略有差异,在Ubuntu18上使用sudo service network-manager start是可行的,但是在Ubuntu22上,network-manager要替换成NetworkManager,否则会提示Failed to start network-manager.service: Unit network-manager.service not found.
版本信息:
- inux version 6.2.0-37-generic (buildd@bos03-amd64-055) (x86_64-linux-gnu-gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2