Linux laptops are known for their high performance and smooth graphics in decently powered devices. But this performance oriented behavior of Linux comes with the cost of battery life of the laptop in comparison to windows counterpart. Recent development of Linux kernel take into account the poor battery life issue and new laptop/desktop oriented distributions like PopOs comes with battery optimization out of the box.
Here, we are discussing top 5 ways to increase battery life in Linux laptops. After reading this article, you can surely choose whatever is the best for you and squeeze up more juice from your battery.
Auto-cpufreq is a tool that actively monitor your CPU usage and scale the CPU governor as per your need. When there is a low CPU usage, auto-cpufreq set the governor to powersave. When system need more performance, performance governor is selected.
You may have a favorite tool that already does this for you, but it likely fails to make use of proprietary peak performance technologies like Intel’s Turbo Boost, a common feature in many laptops over the last few generations. Auto-cpufreq takes these features into account and makes use of them when appropriate. It leads to high performance when you need it the most.
Auto-cpufreq is written in Python. Auto-cpufreq just optimize the battery usage and most of the heavy lifting is done by the kernel itself. If you are already using TLP, auto-cpufreq can conflict with TLP, so it is best to remove TLP from your system before installing auto-cpufreq.
You can use snapd to install auto cpufreq in your laptop:
sudo snap install auto-cpufreq
If you don’t like snaps and want to install auto-cpufreq from the source, first clone the repository using Git:
git clone https://github.com/AdnanHodzic/auto-cpufreq.git
then run the installer.
cd auto-cpufreq && sudo ./auto-cpufreq-installer
The above command run a script and install auto-cpufreq in desired location.
After installation, you can monitor battery usage in your laptop using the
sudo auto-cpufreq --monitor command. If you want to try out auto-cpufreq before installing the daemon, you can do that using the following command.
sudo auto-cpufreq --live
If you are satisfied with live auto-cpufreq optimization, you can now install the daemon which runs in the background and persist your settings across reboot.
sudo auto-cpufreq --install
Check if the daemon is running using
systemctl status auto-cpufreq command.
If you are not happy with auto-cpufreq, you can remove it completely from the system using this command in your terminal.
sudo auto-cpufreq --remove
2. Slimbook Battery
Slimbook battery is a utility coming with Slimbook Linux laptops. As this is an open source project, any Linux user can install this utility in their laptop. Slimbook battery provide a very intuitive UI for users to control their system.
Slimbook battery works with various services and drivers like TLP, Intel P-State, AMD and nVidia. This makes Slimbook battery work in every Linux laptops out there.
The tools has 3 modes – Energy saving, Balanced and Maximum Performance. Each energy mode comes with default values but the user is allowed to change the most important values, to adjust or avoid errors in their hardware.
In Debian/Ubuntu derivatives, you can install Slimbook battery through their official PPA.
sudo add-apt-repository ppa:slimbook/slimbook sudo apt update
After adding the PPA repository, you can install Slimbook Battery in your laptop:
sudo apt install slimbookbattery
You can uninstall Slimbook Battery using this command.
sudo apt purge slimbookbattery
As TLP is installed along with Slimbook Battery, You should remove TLP separately.
sudo apt purge tlp tlp-drw
TLP is a battery management an optimization utility. It helps you to manage your system’s power usage without you having to understand every technical detail about your computer, and it runs in the background so you don’t have to worry about it at all.
A thing to note is that TLP does not replace the existing power management of your Linux installation. Instead, it has its own set of settings and it changes on every change of the power source. TLP’s default settings are already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements.
The things that it manages include:
- Kernel laptop mode and dirty buffer timeouts
- Processor frequency scaling including “turbo boost” / “turbo core”
- Power aware process scheduler for multi-core/hyper-threading
- Hard disk advanced power management level and spin down timeout (per disk)
- SATA aggressive link power management (ALPM)
- PCI Express active state power management (PCIe ASPM) – Linux 2.6.35 and above
- Runtime power management for PCI(e) bus devices – Linux 2.6.35 and above
- Radeon KMS power management – Linux 2.6.35 and above, not fglrx
- Wifi power saving mode – depending on kernel/driver
- Power off optical drive in drive bay (on battery)
In the latest release of Gnome, it comes with Power Profile utility. This tool conflict with TLP. Therefore, remove Gnome Power Profile before installing TLP.
sudo apt remove power-profiles-daemon
If you are using latest Ubuntu 22.04 based distribution, TLP is available in the Ubuntu repository. For other version, you need to add the PPA to your system:
sudo add-apt-repository ppa:linrunner/tlp sudo apt update
Now you can install TLP in your device.
sudo apt install tlp tlp-rdw
If you are using Fedora, you can easily install TLP with this command.
dnf install tlp tlp-rdw
You can uninstall conflicting Gnome Power Profile utility using the following command in Fedora.
dnf remove power-profiles-daemon
After installation, reboot your device and TLP will automatically run in your background. To view the TLP configurations, use the
sudo tlp start -c command. To change the default TLP configuration, edit the “/etc/default/tlp” file.
sudo nano /etc/default/tlp
TLPUI is a GUI application for TLP. Every time you want to change some TLP configuration, you have to look at the TLP documentation for arguments you need to add in the config file. This is a very tedious process. TLPUI streamlines this process and provides a nice graphical experience on top of it to the user.
TLP UI is written in Python and it aims to protect users from setting bad configuration and to deliver a basic overview of all the valid TLP configuration values.
To install TLPUI, you need to have TLP installed in your device. Add TLPUI PPA in your Ubuntu-based distribution:
sudo add-apt-repository -y ppa:linuxuprising/apps sudo apt update
Now install TLPUI using the following command.
sudo apt install tlpui
After the installation, you can launch the application to configure TLP easily.
Powertop is a battery and power management utility for Linux operating system. Powertop is originally developed by Intel. Powertop functions like a system monitor but instead of monitoring RAM and CPU usage, It monitors power usage of every application running in the device.
In addition to being a diagnostic tool, Powertop also has an interactive mode you can use to experiment with various power management settings, for cases where the Linux distribution has not enabled those settings.
Powertop installation is very easy for Ubuntu-based distribution. Run this command to install powertop in your machine.
sudo apt update sudo apt install powertop
If you want to build powertop from source, first you have to install build dependencies in your system. For Debian-based distribution, the command will look like this.
sudo apt install libpci-dev libnl-3-dev libnl-genl-3-dev gettext libgettextpo-dev autopoint gettext libncurses5-dev libncursesw5-dev libtool-bin dh-autoreconf autoconf-archive pkg-config
After installing all the dependencies, clone the Github repository and enter to the cloned directory.
git clone https://github.com/fenrus75/powertop.git cd powertop
Now as you have all the dependencies and codes, you can build powertop in your device very easily.
./autogen.sh ./configure make
After installing reboot your device to activate powertop. Now run powertop with
--auto-tune flag to optimize powertop for your laptop.
To run in calibration mode, use
--calibrate flag. It monitor battery usage by all the running apps and provide an estimation of your laptop battery. If you want to debug powertop, use
--debug flag. This flag is focused for developers.
Visit their github page to know more about powertop and its functioning.
Frequently Asked Questions
Does using Linux increase battery life?
Using Linux don’t increase your battery life. If you are switching from Windows or if you want to revive your old laptop, installing Linux can surely give you a much smoother experience. If you want to increase your battery life, you can to choose low resource consuming desktop environments like XFCE or LXQT.
Which Linux distro is best for battery life?
I have tried most of the modern Linux distribution. Out of which, I find PopOS is the best for battery life. If you install PopOS in your laptop, It comes with system76-power utility. System-76-power can save power and improve battery life in your device.
How to stop battery drain in Linux with Nvidia GPU?
Nvidia drivers in Linux are not open source. Therefore, Linux can’t dynamically scaled up or down Nvidia GPU. If you want to use Nvidia GPU in Linux, either you have to power the GPU all the time or turn it off completely. But recently, Ubuntu developed a technology called “nvidia prime”. Using nvidia prime, you can switch between integrated and Nvidia GPU very easily. Nvidia prime works only Ubuntu-based distribution.
Image credit: Unsplash
Our latest tutorials delivered straight to your inbox