Posted On October 9, 2021

Disable and Enable Sleep Mode on a Linux Workstation

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Disable and Enable Sleep Mode on a Linux Workstation

The following commands would work on any Linux machine with SystemD (Ubuntu, Linux Mint, Redhat, Fedora, etc.)

# Disable Sleep
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

# Output sample:
kim@kim-linux:~$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
[sudo] password for kim:
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null

# Enable Sleep
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

# Output Sample:
kim@kim-linux:~$ sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
Removed /etc/systemd/system/sleep.target.
Removed /etc/systemd/system/suspend.target.
Removed /etc/systemd/system/hibernate.target.
Removed /etc/systemd/system/hybrid-sleep.target.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Ubuntu Repos (Old Info)

Add this using the Software Center deb karmic free non-free   --------------------------- Add Many Repos…

Networking: Upgrading Legacy Ubiquiti Devices

Step 1: obtain the bin URL from https://www.ui.com/download/unifi/unifi-ap/uaplr Step 2: perform the upgrade rambo@kimlinux:/home/rambo# ssh…

How To Change VMWare ESXi Hypervisor’s IP Address and Host Name

# List hypervisor's network interfaces esxcli network ip interface ipv4 get # Sample output [root@esx76:~]…