Extremely slow Ubuntu 20.04 startup
Solution 1:
Here, a quite spartan Ubuntu 20.04
$ systemd-analyze Startup finished in 6.458s (firmware) + 4.588s (loader) + 2.911s (kernel) + 9.150s (userspace) = 23.108s graphical.target reached after 9.136s in userspace $ systemd-analyze critical-chain The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. graphical.target @9.136s └─multi-user.target @9.136s └─kerneloops.service @8.674s +18ms └─network-online.target @8.672s └─NetworkManager-wait-online.service @2.341s +6.330s └─NetworkManager.service @2.224s +115ms └─dbus.service @2.221s └─basic.target @2.209s └─sockets.target @2.209s └─snapd.socket @2.207s +1ms └─sysinit.target @2.201s └─systemd-timesyncd.service @2.065s +135ms └─systemd-tmpfiles-setup.service @2.028s +32ms └─local-fs.target @2.025s └─run-user-125-gvfs.mount @3.152s └─run-user-125.mount @2.975s └─swap.target @2.057s └─dev-disk-by\x2duuid-ed163828\x2d666c\x2d4dae\x2db43c\x2dce7dd1d8bdd2.swap @1.987s +69ms └─dev-disk-by\x2duuid-ed163828\x2d666c\x2d4dae\x2db43c\x2dce7dd1d8bdd2.device @1.983s
I'd say that you need to look through which SW packages you need have start at boot / login.
MySQL and Apache might be of interest.
$ systemd-analyze blame # all output 6.777s plymouth-quit-wait.service 6.330s NetworkManager-wait-online.service 1.640s dev-nvme0n1p3.device 913ms snapd.service 631ms systemd-logind.service 544ms fwupd.service 458ms dev-loop1.device 391ms dev-loop2.device 333ms udisks2.service 309ms dev-loop5.device 303ms dev-loop3.device 298ms dev-loop4.device 227ms accounts-daemon.service 208ms snap-gnome\x2d3\x2d34\x2d1804-72.mount 206ms snap-snapd-13640.mount 202ms snap-snap\x2dstore-547.mount 197ms systemd-resolved.service 186ms networkd-dispatcher.service 174ms snap-bare-5.mount 172ms snap-gtk\x2dcommon\x2dthemes-1519.mount 137ms upower.service 135ms systemd-timesyncd.service 133ms dev-loop0.device 130ms systemd-rfkill.service 118ms snap-core18-2246.mount 117ms systemd-udev-trigger.service 117ms avahi-daemon.service 116ms bluetooth.service 115ms NetworkManager.service 108ms apparmor.service 105ms polkit.service 99ms systemd-journald.service 89ms keyboard-setup.service 86ms [email protected] 86ms switcheroo-control.service 86ms apport.service 81ms thermald.service 77ms wpa_supplicant.service 77ms [email protected] 77ms systemd-udevd.service 73ms grub-common.service 69ms dev-disk-by\x2duuid-ed163828\x2d666c\x2d4dae\x2db43c\x2dce7dd1d8bdd2.swap 67ms gpu-manager.service 52ms systemd-journal-flush.service 47ms ModemManager.service 46ms systemd-modules-load.service 44ms snapd.apparmor.service 42ms secureboot-db.service 35ms e2scrub_reap.service 33ms rsyslog.service 32ms systemd-tmpfiles-setup.service 30ms plymouth-start.service 29ms systemd-fsck@dev-disk-by\x2duuid-32BD\x2d13BA.service 27ms gdm.service 26ms [email protected] 26ms nvidia-persistenced.service 23ms systemd-random-seed.service 22ms systemd-tmpfiles-clean.service 21ms colord.service 21ms pppd-dns.service 21ms snapd.seeded.service 20ms alsa-restore.service 19ms systemd-backlight@leds:asus::kbd_backlight.service 19ms systemd-sysusers.service 19ms sys-kernel-tracing.mount 19ms sys-kernel-debug.mount 18ms dev-mqueue.mount 18ms dev-hugepages.mount 18ms kerneloops.service 18ms systemd-tmpfiles-setup-dev.service 15ms systemd-remount-fs.service 14ms [email protected] 14ms kmod-static-nodes.service 14ms systemd-sysctl.service 12ms systemd-update-utmp.service 11ms plymouth-read-write.service 10ms [email protected] 10ms grub-initrd-fallback.service 9ms systemd-update-utmp-runlevel.service 9ms systemd-user-sessions.service 9ms ufw.service 8ms systemd-backlight@backlight:intel_backlight.service 7ms rtkit-daemon.service 6ms boot-efi.mount 6ms sys-fs-fuse-connections.mount 5ms sys-kernel-config.mount 4ms openvpn.service 3ms setvtrgb.service 3ms console-setup.service 1ms snapd.socket