我在 HP Pavillion 笔记本电脑上同时使用 Windows 10 和 Ubuntu:
Intel® Core™ i7-8750H CPU @ 2.20GHz × 12 NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] / GeForce GTX 1050 Ti/PCIe/SSE2 和 16 GB 内存。
根据'systemd-analyze'
:
启动用时 4.110 秒(内核)+ 1 分 8.206 秒(用户空间)= 1 分 12.316 秒 graphic.target 在用户空间中用时 1 分 7.940 秒达到
如果我输入'systemd-analyze blame'
:
39.619s man-db.service
38.758s plymouth-quit-wait.service
26.468s snapd.service
18.378s logrotate.service
18.269s dev-sda4.device
17.726s networkd-dispatcher.service
12.867s NetworkManager-wait-online.service
11.566s udisks2.service
10.604s dev-loop21.device
10.500s dev-loop25.device
10.321s dev-loop22.device
10.190s dev-loop3.device
9.950s dev-loop26.device
9.862s dev-loop31.device
9.718s dev-loop23.device
9.217s dev-loop28.device
9.184s dev-loop16.device
...
情况一天天恶化,每次更新都更严重。看到过一些关于这个问题的帖子,但按照操作系统标准(Ubuntu 12 或 14),它们已经过时了。
我该怎么做才能让它恢复速度?
编辑:Paladin 希望我做两件事,以下是结果:
#1 的结果sudo systemctl status man-db.service
是:
● man-db.service - 每日 man-db 再生 已加载:已加载(/lib/systemd/system/man-db.service;静态) 活动:未活动(已停止) 触发者: ● man-db.timer 文档:man:mandb(8)
#2 此外,sudo journalctl | grep -i error > error.txt
我得到了一个 93997 行的文本文件。我将最后一次启动的日志包含在下方。
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.PEG0.PEGP._ON], AE_ALREADY_EXISTS (20201113/dswload2-326)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20201113/psobject-220)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.PEG0.PEGP._OFF], AE_ALREADY_EXISTS (20201113/dswload2-326)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20201113/psobject-220)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: Aborting method \_SB.PCI0.SPI1.FPNT._CRS due to previous error (AE_AML_INVALID_RESOURCE_TYPE) (20201113/psparse-529)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: Method execution failed \_SB.PCI0.SPI1.FPNT._CRS due to previous error (AE_AML_INVALID_RESOURCE_TYPE) (20201113/uteval-68)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: Aborting method \_SB.PCI0.SPI2.FPNT._CRS due to previous error (AE_AML_INVALID_RESOURCE_TYPE) (20201113/psparse-529)
Haz 28 20:44:11 Ubuntu2104 kernel: ACPI Error: Method execution failed \_SB.PCI0.SPI2.FPNT._CRS due to previous error (AE_AML_INVALID_RESOURCE_TYPE) (20201113/uteval-68)
Haz 28 20:44:11 Ubuntu2104 kernel: pcieport 0000:00:1b.0: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Haz 28 20:44:11 Ubuntu2104 kernel: pcieport 0000:00:1b.3: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Haz 28 20:44:11 Ubuntu2104 kernel: pcieport 0000:00:1d.0: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Haz 28 20:44:11 Ubuntu2104 kernel: pcieport 0000:00:1d.4: DPC: error containment capabilities: Int Msg #0, RPExt+ PoisonedTLP+ SwTrigger+ RP PIO Log 4, DL_ActiveErr+
Haz 28 20:44:11 Ubuntu2104 kernel: RAS: Correctable Errors collector initialized.
Haz 28 20:44:11 Ubuntu2104 kernel: EXT4-fs (sda4): re-mounted. Opts: errors=remount-ro. Quota mode: none.
Haz 28 20:44:31 Ubuntu2104 systemd[1]: Started Process error reports when automatic reporting is enabled (file watch).
Haz 28 20:44:33 Ubuntu2104 grub-editenv[1162]: /usr/bin/grub-editenv: error: invalid environment block.
Haz 28 20:44:43 Ubuntu2104 NetworkManager[1097]: <warn> [1624902283.1928] Error: failed to open /run/network/ifstate
Haz 28 20:44:47 Ubuntu2104 systemd-xdg-autostart-generator[1381]: Not generating service for XDG autostart app-org.gnome.DejaDup.Monitor-autostart.service, error parsing Exec= line: No such file or directory
Haz 28 20:44:54 Ubuntu2104 /usr/libexec/gdm-x-session[1413]: (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
Haz 28 20:45:09 Ubuntu2104 goa-daemon[1523]: /org/gnome/OnlineAccounts/Accounts/account_1622216939_0: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: No credentials found in the keyring (goa-error-quark, 4)
Haz 28 20:45:08 Ubuntu2104 gnome-keyring-daemon[1406]: couldn't create system prompt: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.keyring.SystemPrompter exited with status 1
Haz 28 20:45:09 Ubuntu2104 goa-daemon[1523]: /org/gnome/OnlineAccounts/Accounts/account_1622208713_0: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: No credentials found in the keyring (goa-error-quark, 4)
Haz 28 20:45:09 Ubuntu2104 gnome-keyring-daemon[1406]: couldn't create system prompt: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.keyring.SystemPrompter exited with status 1
Haz 28 20:45:09 Ubuntu2104 goa-daemon[1523]: /org/gnome/OnlineAccounts/Accounts/account_1622208966_1: Setting AttentionNeeded to TRUE because EnsureCredentials() failed with: No credentials found in the keyring (goa-error-quark, 4)
Haz 28 20:45:09 Ubuntu2104 gnome-keyring-daemon[1406]: couldn't create system prompt: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.keyring.SystemPrompter exited with status 1
Haz 28 20:45:54 Ubuntu2104 gnome-session[1746]: gnome-session-binary[1746]: GnomeDesktop-WARNING: Could not create transient scope for PID 1905: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 1905 does not exist.
Haz 28 20:45:53 Ubuntu2104 gnome-session-binary[1746]: GnomeDesktop-WARNING: Could not create transient scope for PID 1905: GDBus.Error:org.freedesktop.DBus.Error.UnixProcessIdUnknown: Process with ID 1905 does not exist.
Haz 28 20:45:53 Ubuntu2104 gnome-shell[1766]: Error looking up permission: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for geolocation
Haz 28 20:46:00 Ubuntu2104 gnome-shell[1766]: JS ERROR: TypeError: method Gio.File.delete_async: At least 3 arguments required, but only 2 passed
Haz 28 20:46:29 Ubuntu2104 chrome[2340]: Theme parsing error: gtk.css:1555:23: 'font-feature-settings' is not a valid property name
Haz 28 20:46:29 Ubuntu2104 chrome[2340]: Theme parsing error: gtk.css:3593:25: 'font-feature-settings' is not a valid property name
Haz 28 20:46:29 Ubuntu2104 chrome[2340]: Theme parsing error: gtk.css:4055:23: 'font-feature-settings' is not a valid property name
Haz 28 20:46:38 Ubuntu2104 chrome[3289]: Theme parsing error: gtk.css:1555:23: 'font-feature-settings' is not a valid property name
Haz 28 20:46:38 Ubuntu2104 chrome[3289]: Theme parsing error: gtk.css:3593:25: 'font-feature-settings' is not a valid property name
Haz 28 20:46:38 Ubuntu2104 chrome[3289]: Theme parsing error: gtk.css:4055:23: 'font-feature-settings' is not a valid property name
Haz 28 20:46:38 Ubuntu2104 chromium_chromium.desktop[2340]: [2340:3229:0628/204638.941762:ERROR:rankings.cc(781)] Inconsistent LRU.
Haz 28 20:46:38 Ubuntu2104 chromium_chromium.desktop[2340]: [2340:3229:0628/204638.941791:ERROR:backend_impl.cc(1044)] Critical error found -8
第 2 天:我从系统中删除了所有 snap。还清除了 snap-store 和 snapd。创建了“nosnap”文件,这样它就不必再次安装。(我可以使用 linux mint)启动时间现在是 1 分 2 秒。这并不完美,但我正在从机械磁盘运行操作系统。
启动时最耗时的操作是
32.070s plymouth-quit-wait.service
15.017s systemd-journal-flush.service
13.740s networkd-dispatcher.service
13.304s NetworkManager-wait-online.service
10.085s accounts-daemon.service
8.072s udisks2.service
7.821s dev-sda4.device
7.050s smartmontools.service
6.787s NetworkManager.service
6.106s grub-initrd-fallback.service
5.930s polkit.service
5.258s avahi-daemon.service
5.256s bluetooth.service
5.243s iio-sensor-proxy.service
4.565s power-profiles-daemon.service
4.361s ModemManager.service
4.324s switcheroo-control.service
4.320s thermald.service
4.318s systemd-logind.service
4.086s wpa_supplicant.service
3.948s cups.service
我的 systemd-journal 似乎有 1016,2M(用 进行了检查journalctl --disk-usage
)我做了一个 journalctl --verify
无效条目。之后我做了一个sudo journalctl --vacuum-size=1G --vacuum-time=5d --vacuum-files=5
,日志大小减少到 224M
重新启动后,我发现我可以在 50.189 秒内启动。
Startup finished in 3.967s (kernel) + 46.221s (userspace) = 50.189s
graphical.target reached after 46.086s in userspace
现在启动时花费时间最多的是:
28.253s plymouth-quit-wait.service
13.209s NetworkManager-wait-online.service
12.748s networkd-dispatcher.service
10.563s udisks2.service
9.754s accounts-daemon.service
8.904s polkit.service
7.690s avahi-daemon.service
7.688s bluetooth.service
7.655s NetworkManager.service