Fixing Slow Linux Boot
Fixing Slow Linux Boot with systemd-analyze
If your Linux system boots slowly, use systemd-analyze to find the cause and disable unneeded services.
Steps
-
Analyze boot times:
systemd-analyze blameThis shows all services and how long each took to start.
-
Disable unnecessary services:
sudo systemctl disable --now <service-name>Use
disableto stop a service from starting at boot and--nowto stop it immediately. If a service must never start, considersudo systemctl mask <service-name>.Warning: Do not disable essential services (e.g.,
networking,sshdon remote servers, or hardware-critical services). -
Check dependency chains (optional):
systemd-analyze critical-chainThis displays services that block or delay the boot due to dependencies.
Notes
- Re-run
systemd-analyze blameafter changes to verify improvements. - When unsure about a service, search its purpose or test by stopping it temporarily before disabling.