ubuntu 18.04 LTS 内核 4.15.0-135-generic
在双启动笔记本电脑上,由于出现一条错误消息,提示运行 ckfs,因此正常启动被停止。我照做了,但从那以后,我无法连接到 wifi 网络。这台电脑似乎正常启动,但有什么东西阻止了 NetworkManager 启动。
我尝试重新启动,并使用以下命令重新启动 NetworkManager:
[sudo]frepie@frepie-K55N:/var/log$ sudo systemctl start NetworkManager.service
[sudo] password for frepie:
Job for NetworkManager.service failed because the control process exited with error code.
See "systemctl status NetworkManager.service" and "journalctl -xe" for details.
frepie@frepie-K55N:/var/log$
我进行了一些测试。结果如下:
网络管理器:
frepie@frepie-K55N:/var/log$ sudo systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-02-21 06:36:43 EST; 2min 36s ago
Docs: man:NetworkManager(8)
Process: 27872 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, status=1/FAILURE)
Main PID: 27872 (code=exited, status=1/FAILURE)
Feb 21 06:36:43 frepie-K55N systemd[1]: NetworkManager.service: Service hold-off time over, scheduling restart.
Feb 21 06:36:43 frepie-K55N systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 5.
Feb 21 06:36:43 frepie-K55N systemd[1]: Stopped Network Manager.
Feb 21 06:36:43 frepie-K55N systemd[1]: NetworkManager.service: Start request repeated too quickly.
Feb 21 06:36:43 frepie-K55N systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Feb 21 06:36:43 frepie-K55N systemd[1]: Failed to start Network Manager.
journalctl-xe:
frepie@frepie-K55N:/usr/share/dbus-1/system-services$ sudo journalctl -xe
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit NetworkManager.service has failed.
--
-- The result is RESULT.
Feb 21 07:52:06 frepie-K55N sudo[28881]: frepie : TTY=pts/0 ; PWD=/usr/share/dbus-1/system-services ; USER=root ; COMMAND=/bin/systemctl status Netw
Feb 21 07:52:06 frepie-K55N sudo[28881]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 21 07:52:06 frepie-K55N sudo[28881]: pam_unix(sudo:session): session closed for user root
Feb 21 07:52:43 frepie-K55N sudo[28891]: frepie : TTY=pts/0 ; PWD=/usr/share/dbus-1/system-services ; USER=root ; COMMAND=/bin/systemctl journalctl
Feb 21 07:52:43 frepie-K55N sudo[28891]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 ]
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), retry 0. There should be messages before this one gi
Feb 21 07:52:43 frepie-K55N rsyslogd[925]: action 'action 1' suspended (module 'builtin:omfile'), next retry is Sun Feb 21 07:53:13 2021, retry nbr 0.
Feb 21 07:52:43 frepie-K55N sudo[28891]: pam_unix(sudo:session): session closed for user root
Feb 21 07:52:59 frepie-K55N sudo[28895]: frepie : TTY=pts/0 ; PWD=/usr/share/dbus-1/system-services ; USER=root ; COMMAND=/bin/journalctl -xe
Feb 21 07:52:59 frepie-K55N sudo[28895]: pam_unix(sudo:session): session opened for user root by (uid=0)
按照 Deepak Reddy 的要求
Mar 06 08:21:20 frepie-K55N NetworkManager[928]: <info> [1615036880.4374] policy: set 'Wired connection 1' (enp5s0) as default for IPv4 routing and DNS
Mar 06 08:21:20 frepie-K55N dhclient[1139]: bound to 192.168.1.110 -- renewal in 35851 seconds.
Mar 06 13:22:29 frepie-K55N NetworkManager[928]: <info> [1615054949.3635] connectivity: (enp5s0) timed out
Mar 06 13:22:54 frepie-K55N NetworkManager[928]: <warn> [1615054974.3071] error requesting auth for org.freedesktop.NetworkManager.wifi.share.open: Authorization check failed: Failed to open file “/proc/1451/status”: No such file or directory
Mar 06 13:22:54 frepie-K55N NetworkManager[928]: <warn> [1615054974.3095] error requesting auth for org.freedesktop.NetworkManager.wifi.share.protected: Authorization check failed: Failed to open file “/proc/1451/status”: No such file or directory
Mar 06 13:22:54 frepie-K55N NetworkManager[928]: <warn> [1615054974.3103] error requesting auth for org.freedesktop.NetworkManager.wifi.share.open: Authorization check failed: Failed to open file “/proc/1451/status”: No such file or directory
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1172] device (enp5s0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1346] dhcp4 (enp5s0): canceled DHCP transaction, DHCP client pid 1139
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1347] dhcp4 (enp5s0): state changed bound -> done
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1352] dhcp6 (enp5s0): canceled DHCP transaction
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1449] manager: NetworkManager state is now CONNECTED_LOCAL
Mar 06 13:25:05 frepie-K55N NetworkManager[928]: <info> [1615055105.1451] manager: NetworkManager state is now DISCONNECTED
重新安装网络管理器时出错:
frepie@frepie-K55N:~$ sudo apt --reinstall install network-manager
Reading package lists... Error!
E: Unable to parse package file /var/lib/apt/lists/ca.archive.ubuntu.com_ubuntu_dists_xenial-updates_InRelease (1)
E: The package lists or status file could not be parsed or opened.
frepie@frepie-K55N:~$
按照建议,我删除了更新文件中的所有 xenial 引用并运行更新命令,但收到以下错误消息:
frepie@frepie-K55N:~$ sudo apt-get update
[sudo] password for frepie:
Hit:1 http://ca.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://ca.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] ...
...
Hit:20 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu bionic/main i386 Packages
Fetched 15.0 MB in 10s (1,582 kB/s)
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/dpkg/status
E: The package lists or status file could not be parsed or opened.
好的,我成功解决了这个问题
在收到错误“Mergelist /var/lib/dpkg/status 出现问题”后,我采用了一个解决方案,建议去 lib/dpkg 文件夹中获取文件“status”的旧版本,该文件的几个旧版本定期存储在那里。我选择了一个相当新的但不是太新的版本,所以它不会有与实际相同的问题。
因此,我提取了旧版本,将其移动到适当的文件夹中,然后重命名了实际文件,然后正确重命名了旧文件
sudo gunzip dpkg.status.6.gz
sudo mv dpkg.status.6 /var/lib/dpkg/status.arch
cd /var/lib/dpkg
sudo cp status.arch status
然后我更新并尝试升级。升级导致以下错误:
files list file for package 'wpasupplicant' contains empty filename
cd /var/lib/dpkg/info
sudo rm wpasupplicant.list
然后
sudo apt-get install wpasupplicant
更新升级后,原问题已得到纠正。
答案1
根据您发布的内容,似乎没有任何导致失败的原因,因此让我们看看是否可以重新启动它。在终端中,尝试以下操作:
sudo service network-manager force-reload
sudo service network-manager restart
如果这不起作用,那么让我们看看重新安装是否有效:
sudo apt --reinstall install network-manager
如果您可以使用以太网电缆将笔记本电脑插入网络,则此方法通常效果最佳,但如果无法插入并apt
出现“无法获取文件”错误,您可以下载.deb
软件包(可能来自不同的计算机)并像这样安装:
sudo dpkg -i <name of deb package file>
希望这将导致网络管理服务正常运行
答案2
我有时也会因(对我来说)未知原因而卡住。当:
sudo service network-manager restart
没有帮助,然后我发现在我的 18.04.5 LTS 上带有 4.14.0-135-generic 这可以*有帮助:
sudo service networking restart
如果没有的话,我就重新启动。
(* 请注意,它似乎无法在我的另一台装有 20.04.2 LTS 和 5.8.0-44-generic 的机器上运行。)
答案3
您能否发布更多调试信息systemctl status
,但journal xe
并没有说明太多。尝试重新启动并粘贴journalctl -u NetworkManager -f -n100
输出。
答案4
就我而言(使用 Pop!OS),我不得不使用
sudo service NetworkManager restart
因为network-manager.service
不存在。