How to completely disable sleep on Ubuntu 22.04 Desktop
If you use Ubuntu 22.04 Desktop version on your server, you need to make it awake all the time or it will be asleep and you cannot neither ping or ssh it, let alone RDP. So let’s do something to disallow our system to sleep.
Maybe you want to mention that we can change power saving settings to do it as below.
However, I have tried it. If your server reboot and has nobody to login, it would still be asleep after some time(maybe 20 mins). So we still need to use command line to solve issues.
How to disable auto sleep
First of all, turn off auto sleep in GUI shown as before.
Then log into your server as root.
1 | apt install dbus-x11 |
Reference
- https://blog.csdn.net/qq_29103181/article/details/139408264
- https://unix.stackexchange.com/questions/714803/ubuntu-22-04-is-sleeping-even-though-i-changed-the-power-settings-so-it-shouldn
- https://askubuntu.com/questions/1462727/completely-disable-sleep-on-ubuntu-22-04
- https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2204DesktopStopSuspend
- https://zhuanlan.zhihu.com/p/415661679
- https://askubuntu.com/questions/1337649/how-to-disable-suspend-in-20-minutes-from-the-lightdm-login-screen
- https://askubuntu.com/questions/942366/how-to-disable-sleep-suspend-at-login-screen