Disbale automatic suspend Ubuntu 20.04

Disbale automatic suspend Ubuntu 20.04

2022, Jun 06    

To prevent Ubuntu 20.04 system from suspending or going into hibernation, you need to disable the following systemd targets:

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

Verify if the changes have been effected using the command:

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