5

I have a HP Probook running Ubuntu 22.04.

I have changed the settings in the power tab so that the screen shouldn't dim, 'Screen blank' is set to 'never', power mode is on 'performance', and Automatic Suspend is set to 'When on battery'.

Yet, I left the laptop on last night to continue some downloads, and in the morning the laptop was asleep with the power button flashing. Pressing the keyboard keys didn't wake it up, I had to press the power button to wake it. Then it was on the lock screen.

Which settings am I missing that is causing this? How can I prevent it sleeping in 22.04. A lot of threads I have found here are old, and I haven't found a solution.

Any help would be greatly appreciated.

1 Answers1

8

I've had this issue. After some special setting, now it works! These commands are:

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

Then the above services will appear as "masked" which will prevent your Ubuntu 22.04 from going to sleep.

Here are some useful references:

Toby Speight
  • 8,678
lxh2002
  • 81