Why is lubuntu (and Ubuntu) 18.04 slow to start up?

A new install (32bit, 3GB RAM) of Lubuntu 18.04: It runs really well and fast (with all wanted apps installed LibreOffice etc) once started up but:

At boot: a screen full of what look like about 50 errors ending with ...flip-done timeout...

Select OS screen - I choose Ubuntu

Blank screen: nothing for 50s

Blank screen: intermittent disk activity 4min

Login screen displayed: login very fast (about 7s).

These long delays also occur when going into Lock Screen.

Maybe a repeated attempt with timeout is slowing it?

Output of systemd-analyze blame:

$ sudo systemd-analyze blame
     1min 20.648s plymouth-start.service
           8.853s keyboard-setup.service
           8.079s systemd-journal-flush.service
           7.440s dev-sda5.device
           6.897s NetworkManager-wait-online.service
           6.345s apt-daily-upgrade.service
           5.244s systemd-udevd.service
           5.193s systemd-sysctl.service
           3.782s udisks2.service
           3.415s NetworkManager.service
           2.718s ModemManager.service
           2.642s accounts-daemon.service
           2.542s upower.service
           2.415s grub-common.service
           2.353s gpu-manager.service
           2.321s networkd-dispatcher.service
           1.819s systemd-random-seed.service
           1.681s avahi-daemon.service
           1.066s systemd-modules-load.service
            798ms apparmor.service
            718ms systemd-tmpfiles-setup-dev.service
            687ms sys-kernel-debug.mount
            683ms dev-hugepages.mount
            682ms dev-mqueue.mount
            681ms systemd-remount-fs.service
            625ms polkit.service
            558ms swapfile.swap
            485ms systemd-resolved.service
            479ms systemd-timesyncd.service
            460ms apport.service
            434ms pppd-dns.service
            421ms lightdm.service
            415ms rsyslog.service
            413ms plymouth-quit-wait.service
            405ms systemd-journald.service
            400ms alsa-restore.service
            399ms plymouth-read-write.service
            383ms systemd-logind.service
            358ms systemd-rfkill.service
            329ms wpa_supplicant.service
            325ms ufw.service
            289ms kmod-static-nodes.service
            148ms systemd-update-utmp.service
            148ms [email protected]

Also using systemd-analyze time:

Startup finished in 35.963s (kernel) + 1min 43.082s (userspace) = 2min 19.046s
graphical.target reached after 1min 43.069s in userspace

Also the kerneloops and two Network Manager lines were in red in the following:

$ sudo systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 43.069s
└─multi-user.target @1min 43.069s
  └─kerneloops.service @1min 43.030s +36ms
    └─network-online.target @1min 43.027s
      └─NetworkManager-wait-online.service @1min 36.128s +6.897s
        └─NetworkManager.service @1min 32.710s +3.415s
          └─dbus.service @1min 32.333s
            └─basic.target @1min 32.285s
              └─paths.target @1min 32.285s
                └─cups.path @1min 32.284s
                  └─sysinit.target @1min 32.247s
                    └─cryptsetup.target @1min 32.247s
                      └─systemd-ask-password-wall.path @2.743s
                        └─-.mount @2.650s
                          └─system.slice @2.677s
                            └─-.slice @2.650s

This is now a dual-boot machine: that is Lubuntu 18.04 32bit installed alongside the previous Ubuntu 16.04. I worry slightly that the Lubuntu hasn't made its own swap partition and can't access the 16.04's swap partition?

$ sudo lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   5.6G  0 part 
├─sda2   8:2    0 366.2G  0 part 
├─sda3   8:3    0     1K  0 part 
└─sda5   8:5    0    94G  0 part /
sr0     11:0    1  1024M  0 rom  

Solution 1:

The machine is a Dell Latitude D530 32bit with Intel Mobile GM965/GL960 Integrated Graphics. This problem seems quite widespread (turned out to be a bug in Ubuntu 18.04: Bug #1767808 - Launchpad)

Kernel: 4.15.0-43

Firstly I used this to check for delays - very clearly highlighted in red on the commands output:

dmesg

Then I searched online and found this Very long boot time and error messages on LM19 - Linux Mint Forum

This solved the problem: Editing this file: /etc/default/grub

Altered the GRUB_CMDLINE_LINUX_DEFAULT= line to:

GRUB_CMDLINE_LINUX_DEFAULT="video=SVIDEO-1:d quiet splash"

Then:

sudo update-grub

and reboot. Now it all moves super-fast!