It’s no secret that the day-to-day use of a laptop is ultimately governed by its battery. Everything you do, from watching a video to opening your browser, sucks a certain amount of juice from your device. That juice will run out at some point, so the rule of the game is to delay that moment as much as possible.
Unfortunately, Linux doesn’t quite cooperate with you. Although many distributions have made strides in terms of battery efficiency, they don’t make the best use of what your CPU can do to give you the most productive experience.
There is, however, one application that quietly pulls the little levers in your machine to make sure the CPU is never running too hot for its current demand. It’s fair to say that if you’re a laptop user on Linux hoping to extend your battery life as much as possible, auto-cpufreq is a dream come true.
How It Works
Rather than running constant surveillance on your CPU, auto-cpufreq works seamlessly with the Linux kernel to make small adjustments here and there as you use your laptop. It solves a simple issue where most popular consumer-oriented Linux distributions put as much pressure on your system when it’s running on battery as they would if it were plugged in.
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, leading to high performance when you need it the most.
More importantly, it also doesn’t interfere with the tools you already use to monitor your system.
Installing Auto-cpufreq
There are two ways to install auto-cpufreq: using the Snap store and grabbing it from GitHub.
Install auto-cpufreq via Snap
You’ll obviously need to first get a hold of snap. Depending on your Linux distribution, you may already have it. For a detailed guide on snap installation, check out our piece showing you how to do this on various Linux distributions. If you’re using Linux Mint, just follow the steps for Debian and remember that snap is blocked there, so you’ll have to type sudo rm /etc/apt/preferences.d/nosnap.pref
into your terminal before you begin.
Once that’s done, go ahead and install auto-cpufreq via snap:
sudo snap install auto-cpufreq
That’s it! It should install without a hitch.
Install auto-cpufreq via GitHub
Chances are you will already have git out of the box in your distro, but if you don’t, just follow our guide on git for Linux.
Once you’ve sorted that out, acquire the package:
git clone https://github.com/AdnanHodzic/auto-cpufreq.git
After it’s downloaded, run the installer:
cd auto-cpufreq && sudo ./auto-cpufreq-installer
You should now have auto-cpufreq installed in your system.
How to Use Auto-Cpufreq
Now that you’ve got auto-cpufreq, it’s time to test it to see if it doesn’t cause issues with your system. The application has a “test mode” that you can use just for this occasion.
sudo auto-cpufreq --live
Once you’ve executed this command, you’ll see information about your CPU and its performance updated every few seconds while the application runs. Keep the terminal in the background and use your laptop as you would normally. This testing period should let you see if there are any major issues with how the application acts with your particular system.
If you decide to keep it, it’s now time to install the daemon that will run it alongside your operating system as a service:
sudo auto-cpufreq --install
Now that it’s fully installed, it’s time to see if the installation’s working correctly. Reboot Linux, and once you’re back in, if you got the application from snap, run:
systemctl status snap.auto-cpufreq.service.service
If you got it directly from GitHub, run:
systemctl status auto-cpufreq
Should you decide to install the service, auto-cpufreq will now quietly run in the background at all times. You can always check its status by typing:
auto-cpufreq --stats
There’s More You Can Do
It’s important to keep in mind that Linux’s notoriously poor CPU clock management isn’t always the culprit draining your battery. Applications running on your system may just have moments when they’re greedy.
If you want to keep an eye out for what you should get rid of to optimize your battery life, check out our guide on using PowerTOP as a monitoring suite that sniffs out the biggest gourmands on your laptop’s precious power.
Do you have more tricks of the trade that would help others squeeze more longevity from your notebook’s precious milliamp-hours? Feel free to share them in the comments!
Our latest tutorials delivered straight to your inbox