How To Enable & Disable Hibernation in Ubuntu

We explain how to enable or disable hibernate in Ubuntu from the command line and permanently.

Hibernate Ubuntu Directly from the Command Line

Thanks to this option we will execute the hibernation process immediately, for this we will execute the following command, but first we must save all the work that we have open to avoid the loss of it:

sudo pm-hibernate

By executing this command automatically the Ubuntu system will be hibernated.

Now, when we turn on the machine again we will have all our applications as we left them before the hibernation.

This command is useful but if you want to hibernate the machine we will have to execute it again and again.

Permanently Enable Hibernation in Ubuntu

To allow the hibernation process to be constantly in Ubuntu 17 it will be necessary to create the following file using one of the preferred editors, Nano or Vi:

sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

This will create a new file, there we must enter the following text:

[Re-enable hibernate by default in upower] Identity=unix-user:*Action=org.freedesktop.upower.hibernateResultActive=yes

[Re-enable hibernate by default in logind] Identity=unix-user:*Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibitResultActive=yes

In this way, we activate hibernation on the computer.

Now we close the current session, and when we click again on the OFF options we see that the option to hibernate the equipment is already available:

In case we want to remove this option from Ubuntu it will be necessary to access again the file created previously and in the line ResultActive=yes set the value to no:

With this simple method we have enabled, or disabled, the option to hibernate the equipment in order to save energy.

Similar Posts

Leave a Reply

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