Ubuntu Linux users have been without the Hibernate option for some time, primarily due to its inconsistent performance and a general preference for Suspend mode among users.
Although less common and reliable than Suspend, Hibernate mode is still useful in certain situations. It powers down the device completely, offering potential improvements in battery life.
To utilize Hibernate mode on your Ubuntu computer, follow this guide for a straightforward method to enable it.
Hibernate vs. Suspend Explained
A common misconception among Ubuntu Linux users is that Suspend and Hibernate modes are identical. However, they manage power differently during sleep mode.
Selecting the Suspend button on KDE or Gnome desktops places the computer in a low-power state, saving all data to RAM. Despite this, the computer still draws power, though minimally.
In Hibernate mode, the computer's entire state is saved to the hard drive and remains in a 'frozen' state, not using any power.
Both Suspend and Hibernate options are available. For an instant-on experience similar to 'waking' the laptop, choose Suspend for its rapid resume capability. For extending battery life, Hibernate is the ideal choice.
Reactivating and restoring Hibernate mode on Ubuntu
To enable the Hibernate feature on Ubuntu Linux, first, install the necessary package that includes Hibernate functionality.
Open a Terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T for some setups to install Pm-utils.
In the Terminal, use the Apt package manager to download and install the Pm-utils package:
sudo apt install pm-utils
With Pm-utils installed on your Ubuntu computer, the Hibernate function becomes available. To verify, open Terminal and execute the following command:
Note: The Hibernate command requires sudo or root access to function.
sudo pm-hibernate
Assuming the pm-hibernate command executes successfully, you can activate Hibernate mode through the Terminal. Follow the instructions below to add a Hibernate option to the menu.
Reintroducing the Hibernate button on Ubuntu
Once Hibernate mode is enabled on your Ubuntu computer, the primary method to engage this mode is through the Pm-utils hibernation command in Terminal. This might be challenging for less experienced users. Thus, for those who frequently use Hibernate, adding a Hibernate button to the menu is the best solution.
To reintroduce the Hibernate button, edit the 'com.ubuntu.desktop.pkla' file. This requires root shell access, which can then be edited using Nano.
In the Terminal window, enter the following command to access the root shell:
sudo -s
With Terminal Shell now in Super-user mode, the next step is to open the 'com.ubuntu.desktop.pkla' file in the Nano text editor:
nano -w /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
In Nano, press Ctrl + W to search the configuration file. Type 'Disable hibernate' in the search box and press Enter to navigate to the specified section of the configuration file for setting up Hibernate on Ubuntu.
Under the sections 'Disable hibernate by default in upower' and 'Disable hibernate by default in logind', locate the following line:
ResultActive=no
Change it to:
ResultActive=yes
After modifying the configuration file, press Ctrl + O to save the changes, then exit the Nano text editor by pressing Ctrl + X.
The Hibernate button will be added to the menu. On desktop environments like KDE Plasma 5, XFCE4, Mate, or similar Linux distributions, the option will appear in the menu.
This concludes our guide on reactivating and restoring the Hibernate (sleep) mode on Ubuntu. For further questions or clarifications, feel free to leave your comments below. For a deeper understanding of Hibernate, refer to the article Distinguishing Sleep and Hibernate.
