What is the method to prevent Ubuntu from going into sleep mode?

To prevent Ubuntu from entering sleep mode, you can follow the steps below:

  1. Disable the sleep function in system settings.
  2. Open the “System Settings”.
  3. Click on the “power” option.
  4. Set the “Sleep” option to “Off” in the “General” tab.
  5. The system will no longer automatically go into sleep mode.
  6. Disable the hibernation feature using the command line.
  7. Open the terminal.
  8. To edit the hibernation configuration file, enter the following command: sudo nano /etc/systemd/logind.conf
  9. Find the line “#HandleLidSwitch=suspend” in the file and change it to “HandleLidSwitch=ignore”.
  10. Press Ctrl + X to save and exit the editor.
  11. Restart the system to apply the changes.
  12. Disable hibernation with gnome-tweaks.
  13. Open the terminal.
  14. Use the following command to install gnome-tweaks: sudo apt-get install gnome-tweaks.
  15. Type the command “gnome-tweaks” to open the gnome-tweaks tool.
  16. Select the “Power” option on the left navigation menu.
  17. Set the “Close Lid” option to “Off”.
  18. This way, the system will not enter sleep mode when the lid is closed.

Please note that these methods may vary slightly depending on the version of Ubuntu. It is recommended to backup important data before proceeding and to exercise caution.

bannerAds