TLP is a free, open-source and feature-rich utility for battery use optimization on laptops running Ubuntu and other Linux distros. You can find it both in CLI and GUI versions for your ease of use. TLP comes with a default configuration which is pretty much perfectly tuned for your OS and the underlying machine. All you need to do is to install and enable the utility and you are good to go. The utility works by optimizing the power used by hardware devices while your laptop is running on its battery, rather than on AC.
In this article, we will explain how to enable TLP on your Ubuntu machine in order to save battery power through:
- TLP Command Line Interface
- TLP User Interface Utility
We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.
Install and Use the TLP CLI
Open your Ubuntu command line, the Terminal, either through the system Application Launcher search or the Ctrl+Alt+T shortcut.
The next step is to update your system’s repository index through the following command:
$ sudo apt-get update
This helps you in installing the latest available version of software from the Internet.
Please note that only an authorized user can add, remove, and configure software on Ubuntu. Please enter the following apt-get command as sudo in order to install TLP on your system:
$ sudo apt-get install tlp
The system might prompt you with a y/n option to continue the installation. Please enter Y if you want to continue with the installation. The process might take some time, depending on your Internet speed, after which TLP will be installed on your system.
You are now ready to use TLP. Let us first see how to start the utility through the following command; the command starts the TLP service on your system:
$ sudo tlp start
You following TLP command lets you view detailed system information and also the status of the TLP utility:
$ sudo tlp-stat -s
TLP, by default, works according to a preset configuration that is pretty much best suited for your operating system and hardware. You can view this configuration through the following command:
$ sudo tlp-stat -c
Another very useful command is to print the detailed battery report through TLP. Use the b flag with the tlp-stat command to view this information:
$ sudo tlp-stat -b
Remove TLP
If you ever feel like removing this utility from your system, you can so so through the following command as sudo:
$ sudo apt-get remove tlp
Enter y on the y/n prompt and the software will be completely removed from your system.
Install and Use the TLP UI
For a person who is more into the UI, there is a user interface available for the TLP utility. Let us learn how to install it through the command line from the Linux Uprising PPA.
Open the Terminal application and run the following command to add the PPA through which the TLP UI will be installed. We are doing so because TLP UI is not available through the official Ubuntu repositories and neither through the Snap Store.
$ sudo add-apt-repository ppa:linuxuprising/apps
Next, enter the following command in order to update the local repository index with that of the Internet repositories:
$ sudo apt-get update
Now you are ready to install the TLP UI. Enter the following apt-get command as sudo to do so:
$ sudo apt-get install tlpui
The system might prompt you with a y/n option to continue the installation. Please enter Y if you want to continue with the installation. The process might take some time, depending on your Internet speed, after which the TLP UI will be installed on your system.
You are now ready to launch and use the utility.
You can launch the TLP UI through the system Application Launcher search as follows:
Or, by entering the following command in the Terminal.
$ tlpui
This is how the TLP UI looks like. The Configuration tab lets you view and edit the TLP settings. Whereas, the Statistics tab lets you view system and battery use statistics.
The most important button here is the TLP_ENABLE slider On and Off button. Through this button, you can enable/disable battery optimization through TLP, based on your configuration.
Remove TLP
If you ever want to remove the utility from your Ubuntu, you can do so by entering the following command in your Terminal:
$ sudo apt-get remove tlpui
You can also get rid of the added PPA by running the following command:
$ sudo rm /etc/apt/sources.list.d/linuxuprising-ubuntu-apps-bionic.list
So these were two ways through which you can use battery on your Ubuntu system is the most efficient manner. As soon as you enable the TLP service, you will start noticing that your battery life will be prolonged, which is otherwise a frequently encountered problem with laptops running Ubuntu.