我近期不打算放弃 Kubuntu,我每天使用它已有 8 年了。但我确实对我的台式机的启动时间有意见。你看,我还有其他几台装有各种 GNU/Linux 的电脑,其中一台装有相同版本的 Kubuntu,但加载速度要快得多,这让我很困惑,因为那台笔记本电脑已经 10 多年了,而我台式机上的硬件(启动时间很长的那台)有更新的部件。
这是我的 systemd-analyze blame 输出。有人知道我该如何缩短启动时间吗?
6min 15.217s apport-autoreport.service
53.010s mysql.service
52.721s [email protected]
48.015s [email protected]
30.833s snapd.seeded.service
28.589s snapd.service
25.842s udisks2.service
23.875s click-system-hooks.service
19.195s NetworkManager-wait-online.service
18.352s cups.service
17.788s accounts-daemon.service
15.747s power-profiles-daemon.service
15.712s polkit.service
15.619s dev-sda5.device
14.810s nginx.service
13.797s resolvconf-pull-resolved.service
13.741s avahi-daemon.service
13.734s bluetooth.service
13.730s NetworkManager.service
13.711s dundee.service
13.327s ofono.service
12.326s thermald.service
12.320s wpa_supplicant.service
12.317s systemd-logind.service
10.642s systemd-journal-flush.service
10.312s smartmontools.service
9.444s ModemManager.service
8.451s dev-loop14.device
8.336s systemd-modules-load.service
7.379s dev-loop13.device
7.377s teamviewerd.service
7.259s dev-loop20.device
7.222s dev-loop21.device
6.937s dev-loop26.device
6.795s dev-loop8.device
6.705s dev-loop16.device
6.674s dev-loop23.device
6.578s dev-loop22.device
6.509s dev-loop19.device
6.164s systemd-tmpfiles-setup.service
6.158s dev-loop10.device
6.078s dev-loop17.device
6.073s dev-loop25.device
5.939s systemd-sysusers.service
5.651s dev-loop15.device
5.346s dev-loop27.device
5.315s dev-loop9.device
5.162s gpu-manager.service
4.984s dev-loop18.device
4.980s dev-loop24.device
4.802s dev-loop11.device
4.750s dev-loop3.device
4.606s dev-loop5.device
4.416s dev-loop12.device
4.181s dev-loop0.device
4.079s dev-loop6.device
3.910s dev-loop7.device
3.713s apport.service
3.623s packagekit.service
3.616s networking.service
3.542s dev-loop2.device
3.490s apparmor.service
3.465s dev-loop4.device
3.385s snapd.apparmor.service
3.308s dev-loop1.device
3.013s grub-common.service
2.789s systemd-udevd.service
2.727s binfmt-support.service
2.679s ondemand.service
2.657s tlp.service
2.498s systemd-resolved.service
2.338s ua-timer.service
2.090s [email protected]
2.002s e2scrub_reap.service
1.988s mountkernfs.service
1.972s rc.local.service
1.961s rsyslog.service
1.925s virtualbox.service
1.734s keyboard-setup.service
1.648s lm-sensors.service
1.460s systemd-tmpfiles-setup-dev.service
1.438s colord.service
1.337s systemd-udev-trigger.service
1.154s gpsd.service
1.138s systemd-sysctl.service
1.003s apt-daily.service
975ms snap-core18-2796.mount
961ms snap-core18-2812.mount
919ms [email protected]
830ms systemd-random-seed.service
798ms qemu-kvm.service
770ms webfs.service
744ms snap-core22-1033.mount
737ms snap-firefox-3941.mount
707ms snap-canonical\x2dlivepatch-264.mount
655ms systemd-binfmt.service
655ms snap-gtk\x2dcommon\x2dthemes-1535.mount
655ms atd.service
632ms snap-core22-1122.mount
611ms systemd-timesyncd.service
600ms setvtrgb.service
575ms snap-gnome\x2d42\x2d2204-141.mount
550ms snap-gnome\x2d3\x2d38\x2d2004-140.mount
546ms grub-initrd-fallback.service
529ms snap-bare-5.mount
517ms snap-gaming\x2dgraphics\x2dcore22-154.mount
512ms snap-chromium-2805.mount
509ms snap-chromium-2811.mount
502ms ufw.service
467ms kerneloops.service
454ms dev-disk-by\x2duuid-edf0d0eb\x2d60a1\x2d4c6e\x2d8359\x2d526683b0584b.swap
445ms systemd-journald.service
435ms snap-core20-2182.mount
435ms openvpn.service
433ms snap-core20-2264.mount
428ms console-setup.service
390ms snap-snapd-21184.mount
389ms snap-shortwave-83.mount
384ms snap-cups-1024.mount
377ms systemd-tmpfiles-clean.service
361ms sddm.service
356ms snap-gnome\x2d3\x2d28\x2d1804-198.mount
318ms dns-clean.service
315ms snap-gtk\x2dcommon\x2dthemes-1534.mount
307ms plymouth-start.service
284ms systemd-user-sessions.service
280ms snap-gnome\x2d3\x2d28\x2d1804-194.mount
277ms snap-shortwave-87.mount
276ms mountdevsubfs.service
275ms systemd-update-utmp.service
270ms systemd-remount-fs.service
236ms snap-gnome\x2d42\x2d2204-172.mount
230ms snap-firefox-4090.mount
227ms snap-gnome\x2d3\x2d38\x2d2004-143.mount
213ms snap-cups-1041.mount
200ms lvm2-monitor.service
190ms dev-hugepages.mount
189ms dev-mqueue.mount
186ms sys-kernel-debug.mount
185ms update-notifier-download.service
184ms sys-kernel-tracing.mount
176ms proc-sys-fs-binfmt_misc.mount
173ms kmod-static-nodes.service
168ms [email protected]
166ms [email protected]
162ms upower.service
161ms [email protected]
130ms snap-gaming\x2dgraphics\x2dcore22-166.mount
128ms mnt-f269f04f\x2d22b5\x2d4d5e\x2d9210\x2d1744425f9650.mount
127ms ifupdown-pre.service
127ms snap-snapd-20671.mount
91ms rtkit-daemon.service
58ms plymouth-read-write.service
45ms mountnfs.service
27ms plymouth-quit.service
26ms alsa-restore.service
25ms checkroot.service
25ms checkfs.service
18ms run-qemu.mount
18ms checkroot-bootclean.service
18ms [email protected]
17ms mountall.service
16ms mountall-bootclean.service
14ms bootmisc.service
11ms var-snap-firefox-common-host\x2dhunspell.mount
10ms modprobe@efi_pstore.service
9ms systemd-update-utmp-runlevel.service
9ms mountnfs-bootclean.service
9ms ureadahead-stop.service
6ms sys-fs-fuse-connections.mount
4ms sys-kernel-config.mount
3ms snapd.socket
2ms postgresql.service
110us blk-availability.service
我已经 8 年没有在这台电脑上安装 Linux 了。我更换过零件,将旧硬盘克隆到新硬盘上,等等,但我仍然有一堆 8 年前的文件,甚至还有一些我使用 Windows 7 时的东西。我确信这可能与此有关,但我对全新安装感到不安……我每两年从 Kubuntu 升级一次(针对 LTS 版本),到目前为止没有任何问题,除了我遇到的启动缓慢问题,而且似乎随着时间的推移越来越严重。我想看看我是否可以在 2 分钟或更短的时间内完成加载,但我不知道这个目标有多实际。在我的其他 GNU/Linux 系统上,不到一分钟的启动时间是很正常的,但这台台式机在启动时很难准备好,而且多年来一直如此。
请记住,apport 进程不会阻止我使用我的桌面,我发现在我加载程序等之后,总会有一两个进程在后台运行几分钟。
PS 我没有使用任何 SSD 驱动器。我有一个 FireCuda 混合固态驱动器(新的旧库存,刚开始使用)作为我的主硬盘驱动器,还有一个 7200rpm 驱动器作为我的辅助硬盘驱动器(也是新的旧库存)。
ps 有人问我是否可以上传我的 systemd-analyze 时间。好吧,就是这个:
Startup finished in 46.778s (kernel) + 6min 52.063s (userspace) = 7min 38.842s
graphical.target reached after 1min 40.828s in userspace
systemd-analyze critical-chain 的结果:
graphical.target @1min 40.828s
└─multi-user.target @1min 40.827s
└─whoopsie.service @6min 21.969s
└─network-online.target @1min 6.981s
└─NetworkManager-wait-online.service @47.784s +19.195s
└─NetworkManager.service @34.048s +13.730s
└─dbus.service @34.040s
└─basic.target @33.989s
└─sockets.target @33.989s
└─snapd.socket @33.979s +3ms
└─sysinit.target @33.577s
└─systemd-timesyncd.service @32.965s +611ms
└─systemd-tmpfiles-setup.service @26.468s +6.164s
└─local-fs.target @26.356s
└─run-user-1000-doc.mount @3min 35.462s
└─run-user-1000.mount @2min 43.477s
└─swap.target @26.335s
└─dev-disk-by\x2duuid-edf0d0eb\x2d60a1\x2d4c6e\x2d8359\x2d526683b0584>
└─dev-disk-by\x2duuid-edf0d0eb\x2d60a1\x2d4c6e\x2d8359\x2d526683b05>