How to Stop Ubuntu from Automatically Hibernating on Low Battery

The Emergency Shutdown

When you are running an Ubuntu laptop on battery power, the operating system’s power management daemon carefully monitors the remaining charge. By default, when the battery drops to a critically low level (usually around 5%), Ubuntu attempts to protect your data by automatically forcing the system into hibernation (suspend-to-disk) or a hard power-off. While theoretically safer than a sudden power loss, hibernation on Linux can be notoriously buggy. It often fails to write the RAM contents to the swap partition correctly, resulting in a frozen black screen, corrupted files, and a system that refuses to wake up, requiring a hard physical reset anyway.

Disabling the Critical Action

If you prefer to drain your battery completely or trust yourself to plug the laptop in before it dies, you can stop Ubuntu from automatically triggering the buggy hibernation sequence during a low-battery event.

This critical power action is not exposed in the standard GNOME Settings panel. You must modify the `UPower` configuration file directly. Open your terminal (Ctrl+Alt+T). Type the following command to edit the file with administrator privileges: sudo nano /etc/UPower/UPower.conf. Press Enter and provide your password. Use your arrow keys to scroll down until you locate the line that reads CriticalPowerAction=HybridSleep (or `Hibernate`). Change the value after the equals sign so the line reads exactly: CriticalPowerAction=PowerOff (if you just want it to shut down cleanly) or CriticalPowerAction=Nothing (if you want the OS to completely ignore the critical battery state, though this is risky). Press Ctrl+O then Enter to save, and Ctrl+X to exit. Finally, restart the UPower service by typing sudo systemctl restart upower.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.