More and more operating systems become bloated with lots of services that run in the background. While they may not use much CPU time, they increase boot time and RAM usage. Fortunately, open-source operating systems give you the power and freedom to do as you see fit. This means you can disable or remove anything you don’t need. Here we show you how to disable unnecessary services to improve your Linux boot time.
Note: We show you how to disable services rather than remove them. Disabling services has lesser risk of permanently breaking things. And you can go back to the way it was before by simply re-enabling a service if you notice something useful stopped working.
Analyze the Time It Takes for Each Service to Load
Most Linux-based operating systems use Systemd by default. Among the suite of utilities it includes, there is a program that lets you analyze how fast your system boots. Specifically, it shows you the total time required to boot and the time it takes for each service to load. Note that some services load in parallel. So, if one requires two seconds to load and the other three seconds, it doesn’t necessarily mean five seconds are required in total. It may be much less than that.
Open a terminal emulator and enter this command:
systemd-analyze
This shows how long it takes for the Linux kernel and core system services to initialize. It does not account for the time required for desktop animations or user applications to finish loading.
However, you can see the time required by the graphical interface to initialize with this command:
systemd-analyze critical-chain graphical.target
This shows the chain of services leading up to the graphical target being reached. While useful, this represents a technical milestone rather than the moment when the desktop is fully idle, as some background components may continue loading afterward.
Note: Programs that start automatically within the desktop environment are typically managed through desktop-specific autostart settings or systemd user services.
Finally, probably the most useful command for the purpose of this tutorial is:
systemd-analyze blame
You can navigate the list with your arrow keys or PAGE UP and PAGE DOWN. Press q to quit.
Use Systemctl to Disable Unnecessary Services
As you can see in the previous picture, some services like snapd takes several seconds to load. On an SSD, this is negligible. But on a traditional hard disk, these kinds of times would be in the orders of multiple seconds, and they would add up to a lot in the end.
Say you don’t need the snapd service, which provides access to containerized application snaps. You can disable it with this command:
sudo systemctl disable snapd.service
After rebooting, you may still see snapd start under certain conditions. This happens because snapd uses socket activation, allowing it to start on demand even when the service itself is disabled.
You can identify related units with:
systemd-analyze blame | grep snap
This helps you identify which Snap-related units are contributing to startup activity.
Dealing With Socket-Activated Services
Some services, including snapd, use socket activation. This means the service can still start when something tries to communicate with it, even if it’s disabled.
If snapd continues to appear after rebooting, related units such as snapd.socket or snapd.seeded.service may be responsible. In cases like this, masking the service and its socket is more effective:
sudo systemctl mask snapd.service
sudo systemctl mask snapd.socket
Masking blocks the service entirely so dependencies or socket cannot start it. However, use this approach carefully, especially on distributions that rely on Snap packages for system updates or applications.
Also, be careful not to confuse “disable” with “masking” in this context. Disabling a service tells systemd not to start it automatically. Masking goes further by preventing the service from starting at all. In most situations, disabling is sufficient. Masking is useful for services that stubbornly restart or are clearly unnecessary on your system.
Further, depending on your setup, you may find additional services that you can safely disable, such as:
avahi-daemon.service
ModemManager.service
thermald.service
However, make sure you always research a service before disabling it. What’s unnecessary on a desktop system may be essential on a laptop or server.
Final Thoughts
Disabling unnecessary services can reduce boot time and free up system resources, especially on systems using traditional hard drives. Even on modern SSD-based systems, trimming unused services helps keep your system clean and efficient.
In addition, graphical tools, like Stacer, exist for managing services, but they often provide limited control or outdated functionality. For consistent and precise management across distributions, the systemctl command-line tool remains the most reliable option.