How to Install Curtail on Ubuntu 22.04 LTS
Want to keep your battery healthy and trim unnecessary processes? You’ll learn how to get Curtail, the lightweight command‑line power‑manager, onto a fresh 22.04 system in under ten minutes.
Getting Curtail up and running
Curtail sits behind two binaries: curtail for real‑time monitoring and curtailctl for setting thresholds. Ubuntu’s default repos don’t ship it, so we’ll pull the latest release from GitHub, compile it, and wire it into your user profile.
Step 1: Install build essentials
sudo apt update sudo apt install -y git make gcc
Why this matters? git fetches the source; make orchestrates the build; gcc compiles C code. Skipping any of these will stall the process with cryptic errors.
Step 2: Grab the latest source
cd ~ git clone https://github.com/curtail/curtail.git
I’ve seen users try to download a ZIP, then run make from inside it—no thanks. The Git checkout gives you branch info and commit hashes, handy if you need to roll back.
Step 3: Build the binaries
cd curtial make
During compilation you’ll notice output like “Compiling src/curtail.c” and then “Linking curtial”. If anything fails here, double‑check that your compiler version is current; older GCCs choke on the -std=gnu11 flag Curtail uses.
Step 4: Install the executables
sudo make install
This drops curtail and curtailctl into /usr/local/bin. I’ve found that installing to /usr/local keeps them out of the way of system updates, but still reachable from any shell.
Step 5: Verify the installation
curtail --version curtailctl status
You should see a version number and “idle” or “active” status. If curtailctl status reports “unknown”, it means the daemon hasn’t started yet—let’s fix that.
Step 6: Enable Curtail as a systemd service
sudo cp contrib/curtail.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable curtial sudo systemctl start curtial
Why this step? Without the service, Curtail only runs while you keep its terminal open. Enabling it ensures power‑saving rules kick in automatically when you boot.
Step 7: Configure battery thresholds
Open /etc/curtail.conf (create it if missing):
sudo nano /etc/curtail.conf
Add your own limits; a sane default is:
# Keep the battery between 30% and 80% min = 30 max = 80
When you hit CTRL+O, Enter, CTRL+X the changes take effect on the next restart of curtail. I’ve used this to keep a laptop’s battery in a sweet spot for gaming, and it keeps the phone‑like lifespan.
Step 8: Test it out
sudo systemctl restart curtial
Then drain your battery with a heavy workload—watch curtail in action. If you see messages like “Throttle power to X%”, you’re good. If nothing happens, double‑check that the thresholds are not too wide for your usage.
Quick troubleshooting
- “make: No rule to make target ‘install’”* – you’re probably still in the repo root. cd into the folder containing the Makefile first.
- “permission denied” when running curtailctl – remember that this command requires root unless you’ve set up policy‑Kit rules. The simplest fix is to prefix with sudo.
Done
You now have Curtail on Ubuntu 22.04, ready to keep your laptop’s battery from over‑charging and under‑discharging. It’s a thin layer over the kernel’s power controls, but it gives you an extra knob in the mix—no bloatware or hidden services.