Posted: 30 October 2018. At: 9:13 AM. This was 6 years ago. Post ID: 12638
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to optimize boot up times on Ubuntu 18.04.

There are quite a few services running on Ubuntu, they can slow down bootup times and be very annoying. One of the best ways to find out which is to use this command.

The systemd-analyze blame command. This will print out a list of the services started on boot.

Here below is an example. This prints the 10 most time hungry services started on bootup.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ systemd-analyze blame | head -n 10
     1min 1.682s apt-daily-upgrade.service
         40.282s apt-daily.service
         29.757s mysql.service
         29.200s dev-mapper-fedora\x2droot.device
         23.012s systemd-journal-flush.service
         20.276s systemd-tmpfiles-setup-dev.service
         16.319s lvm2-monitor.service
         14.483s systemd-sysctl.service
         13.653s networking.service
         11.000s libvirtd.service

I chose to switch off the apt services, as they are not necessary. They take too much time to load on startup.

This is how I did it.

Stopping the unwanted services.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ sudo systemctl stop apt-daily-upgrade.service
1) All commands run with root privileges are always dangerous.
2) Never run commands on an environment you are not willing to destroy, or able to restore.
3) Do not become root until you know what you are going to do.
4) Be sure of your command and what is going to be affected by it.
[sudo] password for jason: 
Warning: Stopping apt-daily-upgrade.service, but it can still be activated by:
  apt-daily-upgrade.timer
4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ sudo systemctl stop apt-daily.service
Warning: Stopping apt-daily.service, but it can still be activated by:
  apt-daily.timer

Then disabling them, so they do not run on bootup.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ sudo systemctl disable apt-daily-upgrade.service
4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ sudo systemctl disable apt-daily.service

This is a very simple way to speed up your boot time on a modern Ubuntu system.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.