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 blame
This shows all services and how long each took to start.
-
Disable unnecessary services:
sudo systemctl disable --now <service-name>
Use
disable
to stop a service from starting at boot and--now
to stop it immediately. If a service must never start, considersudo systemctl mask <service-name>
.Warning: Do not disable essential services (e.g.,
networking
,sshd
on remote servers, or hardware-critical services). -
Check dependency chains (optional):
systemd-analyze critical-chain
This displays services that block or delay the boot due to dependencies.
Notes
- Re-run
systemd-analyze blame
after changes to verify improvements. - When unsure about a service, search its purpose or test by stopping it temporarily before disabling.