Table of Contents
This practical guide explains how to disable auto-suspend in linux with clear steps and useful context. It also covers common requirements, potential problems, and the details that can help you get better results.
However, that doesn't mean the auto-suspend feature is completely useful. It is often annoying and disrupts your workflow, such as when you are trying to read a long web page or actively running an application in the background. In these situations, disabling auto-suspend will allow you to get the most out of your Linux system.
How to Disable Auto-Suspend Using the GUI
One of the easiest ways to turn off auto-suspend on your computer is to use the Settings app. You can adjust System Suspension settings in Ubuntu and similar distributions by navigating to Settings > Power . Click Automatic Suspend and toggle the two settings so your computer doesn't automatically suspend when on battery power or when plugged in.

If you're not opposed to using an app to prevent auto-suspend, you may also find that programs like Caffeine will help you with the problem. Otherwise, the process is similar for distributions other than Debian and Ubuntu such as Arch Linux - although you may need to look for distro-specific configurations.
It should be noted that you may need to check your BIOS settings if your computer continues to automatically suspend or sleep despite adjusting the settings. After you have opened the BIOS by restarting your PC, you can usually configure the sleep settings by navigating to the Power Management tab.
How to Disable Auto-Suspend from CLI
You'll find it just as easy to disable auto-suspend using the command line interface (CLI) on Linux, as you only need to enter a few commands on most distributions.
On Debian-based distributions such as Ubuntu and Linux Mint, you can disable the suspend daemon (and verify that its status is disabled) with the following commands:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

If you successfully disable the daemons responsible for system hibernation and sleep, the second command will result in a result that says ' Loaded: masked (Reason: Unit [daemon].target is masked. ) Active: inactive (dead)' for each daemon listed in the command. You may need to reboot the system before the changes take effect.
The process for disabling automatic suspend in other distributions is similar, although you may need to research some forums for specific advice. In Arch Linux, adding the following lines to .xinitrc with sudo nano /etc/X11/xinit/xinitrc usually fixes the problem:
xset s off xset -dpms xset s noblank
If you have a laptop that wants to prevent suspending after closing the lid, you will also need to edit the configuration file /etc/systemd.logind.conf. Open the file with the following command, add the lines followed by the asterisk, and close and save the file to disable the system suspend caused by the laptop closed:
sudo nano /etc/systemd/logind.conf * [Login] HandleLidSwitch=ignore HandleLidSwitchDocked=ignore
Entering the above command is very important if you plan to disable auto-suspend on your laptop. On the other hand, the systemd-logind daemon will try to call sleep.target hundreds of times per second when the lid is closed. Although it can be troublesome to tweak logind.conf , it will help keep your computer's CPU from being overloaded.
It's important to note that you can easily re-enable auto-suspend. If you want to run these system services again, you can enable them on your system by opening a terminal and entering the following commands:
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
Conclusion
Understanding Auto-Suspend makes it easier to compare options, avoid common mistakes, and apply the information in this guide more effectively. Review the relevant requirements before making changes or choosing a solution.
FAQ
How do you disable auto-suspend in linux?
Follow the steps in this guide in order, confirm the required settings or tools, and verify the result before making additional changes.
Is it safe to disable auto-suspend in linux?
It is generally safe when you follow the recommended instructions, use trusted tools, and avoid changing settings you do not understand.
What should you do if the process does not work?
Recheck the requirements, restart the device or application when appropriate, and review each step for missed settings or compatibility issues.
Reader Comments 0
Sign in with email or Google to join the discussion.