I've installed the latest version of ElementaryOS (as of a few days ago) and am looking for a way to prevent it from falling asleep or suspending. In System Settings->Power I've set "Suspend when inactive for:" to Never. Anything else I need to set?


2 Answers 2


Figured this out. The settings in System Settings->Power don't seem to make any difference, at least on my particular BIOS or motherboard or whatever. However, this command will fix the problem and prevent the machine from ever sleeping:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

  • 1
    That might be a bug; it should honor the power settings.
    – Ken Kinder
    Commented Apr 29, 2019 at 19:32

did you set "Plugged In" OR "On Battery" ? they are different.

  • I don't see anything about plugged in or battery. Note this is on a desktop computer, so perhaps the OS is aware of that and knows there's no battery? Commented Oct 30, 2018 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.