Subtly broken is worse than frankly broken...


  1. I already disabled suspend in System Settings -> Power.

  2. The "Suspend" option still appears on the gear menu (not that I expected it to disappear), and the sleep (moon) button on my keyboard still triggers suspend.

  3. The options in #1 are, as others have pointed out, just too easy to hit by mistake once every month or so.

  4. It seems like 1% of platforms get suspend right, because some driver engineer somewhere forgot to check that PCIe or IO space register X gets restored when upon wake. So it's worse than broken: everything usually looks fine after waking up, only it's not. And hopefully none of those corrupted registers affects reliability in a creeping manner, like ECC configuration or storage FIFO depth. But they usually do, in one form or another, which is one reason, for example, why errata against graphics drivers continue infinitely, years after they debut on the market ("graphics chip X hangs an hour after resuming from suspend blah blah blah").

  5. There should be an automated test to see what registers change across a sleep cycle, but few vendors have such a test. The test is complicated somewhat by the fact that some registers are expected to change, such as timers. And worse, sometimes you have to read registers in a certain order or with a particular granularity, or by first writing a read index somewhere else. So this process cannot be centralized at a convenient place in the industry, like Canonical's offices. It's really and truly hopeless unless PCIe is redefined in such a manner that makes comparison easy, which it won't be.

  6. The magical test suite in #5 will never be written because of the chaotic state of driver development. Hence in the absence of that, my question.

  7. I'm so desperate that I don't mind hacking on /etc/whatever_suspend_file, but it would be nice if there were a "polite" way to do this, like that nonexistent checkbox in System Settings -> Power that says "Permanently disable suspend because it was ill-conceived from day one."

  8. NB: I'm not talking about hibernation here, which shouldn't suffer from the problems above because it involves a power cycle. Although in principle, restoring registers from permanent storage could have similar problems.

  • 3
    Did you try the answer here: askubuntu.com/a/154821/72576? – jobin May 27 '14 at 17:57
  • The crowd-sourced version of #5 can work. It just takes enough people willing to set sleep to 5 minutes or so, and file bug reports. As you note it's hardware specific: but many many machines and people are lucky and sleep is a good thing. – Bryce Aug 29 '18 at 17:51

According to the Debian Wiki, you can also disable it via systemd like so:

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

While I have done this on my machine, I can't attest to its effectiveness. Not brave enough to try it out intentionally.

  • 1
    Worked well for me on Debian 10. Even greyed out or removed the corresponding menu items and buttons in assorted GUI controls. Thank you! Btw systemctl unmask can be used to restore anything that's been systemctl masked. – flabdablet May 7 '20 at 23:52
  • Worked well for me on Ubuntu Budgie 19.10. – Luke Sheppard Jul 4 '20 at 21:30
  • 2
    Still works on Ubuntu Focal 20.04 – Fernando Silveira Sep 9 '20 at 13:41
  • 1
    Works perfectly, even causes KDE to automatically not show the 'Suspend' and 'Hibernate' options in the UI. Tested on Kubuntu 20.04 – happyskeptic Jan 6 at 2:14

On Ubuntu 16.* try this.

Go to:

  • System Settings

Click on:

  • Brightness & Lock

  • Turn screen off when inactive

  • Set it to 'Never'

Hope it helps :)

  • The question is about suspend and you give advice on screen turn off. – Timo May 3 at 19:09

Run the following command to open the file to edit:

sudo -H gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

Scroll to the bottom. Check to see if the following information exists, and if not add them:

[Disable suspend]

Doing this makes suspend do nothing when you click it; it will disappear from the menu after you restart your computer.

You can run this command also to prevent computer from sleeping:

gsettings set org.gnome.desktop.session idle-delay 0
  • 1
    That seems like the logical place for this, but I tried it and it doesn't work in my 14.04 environment. But I think you're on the right track, because in this file I can see similar code for disabling hibernation. – Veiokej May 27 '14 at 18:27
  • 6
    This procedur no longer works in 14.04+ releases. See this alternative procedure: askubuntu.com/questions/452908/how-to-disable-suspend-in-14-04 – lrosa Dec 19 '15 at 5:52

With dconf Editor, navigate to:


You will find lots of options relating to sleep and suspend.

  • Looks promising, but nothing to modify thus far: dconf read /org/gnome/settings-daemon/plugins/power/lid-close-battery-action 'nothing' dconf read /org/gnome/settings-daemon/plugins/power/lid-close-ac-action 'nothing' dconf read /org/gnome/settings-daemon/plugins/power/idle-dim false – Veiokej May 29 '14 at 12:57


Have you looked at:

System -> Preferences -> Power Management

On AC Power Tab, Put computer to sleep when inactive for: "Never"


Can you open up "gconf-editor"?

Look in: /apps/gnome-power-manager/timeout

Try setting sleep_computer_ac to 0

I'm not positive if anything else needs to be changed as well.

Get also a look here.

  • No such menu is visible in my 14.04 environment. I don't actually have that file, but I don't think I'd want to mess with the power management timeouts, or at the other extreme, disabling power management wholesale (unless there's actually no way to disable only suspend). – Veiokej May 27 '14 at 18:29
  • It's also not present in 16.04. – MERose Jan 10 '17 at 8:27
  • no /apps/gnome-power-manager/timeout in gconf-editor – markackerman8-gmail.com Nov 14 '19 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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