186

This question is present as a matter of historical interest. While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the FAQ.

Is it possible to greatly extend the usage time of a laptop or notebook running on battery by disabling various services and installing various packages?

What tricks or tips do people have for getting an extra hour or two out of their batteries?

24 Answers24

85

Use powertop to see which programs are doing unneeded background processing such as beagle/tracker, weather notifications, gnome-do, and (if you don't need the internet) network-manager, mail-notifications.

Run sudo powertop --auto-tune to set all tunable options to their GOOD settings.

Anthony Wong
  • 921
  • 6
  • 20
  • 39
    A tip about powertop. If you are using an external usb mouse and powertop ask about autosuspending usb, don't do it.

    You mouse will be suspended and it will drive you crazy. At least it did it to me.

    – Javier Rivera Aug 06 '10 at 13:47
  • 1
    @javier sadly, I read this too late and am having the exact same problem. Tried changing power/autosuspend to both 0 and -1 but without effect (have not tried rebooting yet). How did you solve this problem? – Aron Rotteveel Jan 26 '11 at 19:00
  • Restarting should solve it. You can also echo -1 > /sys/bus/.../yourmouse but it's usually easier to restart. – Javier Rivera Jan 27 '11 at 08:32
  • 7
    Great app but how can I make the changes more permanent rather than have to do the same everytime I log in? – andybleaden Aug 04 '11 at 13:49
  • 1
    I find this hardly useful if I have to apply the settings every time I reboot. How can I apply custom settings in powertop automatically? –  May 11 '12 at 05:50
  • 1
    @AronRotteveel I succeded to turn back my settings with powertop: sudo powertop, then navigate with right arrow to "Tunables" and navigate down with downarrow and press "Enter" on the relevant line, to switch back to previous value (Should say "Bad" in the left column when it is normal, for the mouse line, at least for me). – Samuel Lampa Jun 26 '13 at 21:13
  • 2
    @andybleaden http://www.makeuseof.com/tag/powertop-will-maximize-your-linux-laptops-battery-life/ this post tells how to do this permanently. You might consider adding this information to your answer Niall. – sage88 Apr 03 '15 at 15:39
  • holy moly, before I used this my battery life expectancy was 2 hrs, after using the autotune I got 4 - 5 hrs. – VishnuVS May 05 '20 at 05:36
  • I wrote a simple python script to parse the output of the "powertop --html" command. It creates a file containing the necessary commands which you would otherwise have to copy-paste into your rc.local file: https://gist.github.com/gyadam/866940153ff94ca68610c2bc870ec69d – adamgy Nov 20 '20 at 03:44
32

Install the package laptop-mode-tools.

This package is not necessary on newer versions of Ubuntu:

  • 1
    A kernel feature that saves power by spinning down the HDD for longer periods, and also managing daemons depending on power mode, auto hibernation and adjusting terminal and X11 blanking. – invert Aug 06 '10 at 10:48
  • Does GNOME already use the kernel's laptop mode without installing this? – Ryan C. Thompson Aug 06 '10 at 18:10
  • 14
    Are these tools moot when using a SSD?

    Will they affect performance negatively?

    – Dmitriy Likhten Aug 13 '10 at 15:34
  • 1
    @DmitriyLikhten I think yes. Because, according to the description "it also supports various other power management features, such as starting and stopping daemons depending on power mode, automatically hibernating* if battery levels are too low, and adjusting terminal blanking and X11 screen blanking."* –  May 11 '12 at 05:47
26

I've been able to more than double the battery life of my netbook by turning off a bunch of services I don't need, and unloading their kernel drivers.

Use service --status-all to see what's running on your system, and service <service-name> stop to shut it down.

Use lsmod to see what kernel modules are loaded, and rmmod <module> to unload it.

If/when you want to bring things back, easiest way is to simply reboot.

Sometimes you also need to kill daemons or programs that are using the service or driver before they can be turned off. Look at output from ps aux to see what's running, and kill -9 <pid> to terminate them.

Services I usually turn off include: Ubuntu One, ssh, apache, databases, avahi, pulseaudio, cups, apparmor, acpi-daemon, bluetooth. Modules I unload: The whole audio stack, usb_storage, webcam drivers, wireless, bluetooth. (Some services like audio don't die easily.)

I've even gone as far as shutting down x (service gdm stop) and working entirely just from consoles, which let me stretch my netbook battery life to nearly 8 hours.

Bryce
  • 4,710
25

Here are a few ideas:

  • Turn off WiFi and Bluetooth
  • Reduce screen brightness
  • Reduce desktop effects (System->Preferences->Appearance->Visual Effects->None)
  • Use Hibernate rather than suspend power features (System->Preferences->Power Management->On Battery Power)
  • Oops! I see that Marco Ceppi posted a similar comment just as I was submitting my own! Sorry about the duplication. – eugenemarshall Jul 29 '10 at 16:31
  • No worries - you've touched a few settings I didn't! – Marco Ceppi Jul 29 '10 at 16:32
  • 7
    Enabling or disabling desktop effects generally has no impact on battery consumption (again, see http://www.codon.org.uk/~mjg59/power/good_practices.html ).

    In empirical tests, power consumption of Compiz vs Metacity was the same, within the limits of measurement accuracy (0.1W).

    – RAOF Oct 11 '10 at 09:40
  • 2
    this is the worst solution, with win77 64bit also win8 64, i can get with turned on wifi bluetooth half screen birghtness, about 3 hours of surfing on internet, listening song on youtube in Hd, browsing facebook, doing some other stuff. When i do it on ubuntu or elementaryos or any other linux distro regardless of DE and its effects. i cant get more than 2 hours. – Erik Kubica Jul 02 '14 at 05:09
  • Does reducing screen resolution help? – Orion Aug 24 '16 at 18:53
15

Improve Power Usage / Battery Life In Linux With TLP

I will Update my answer on Is there a power saving application similar to Jupiter?, please have a look

Qasim
  • 22,092
13

Apart from using Jupiter, I was using TLP and it helped a little. Plus, it is my advice to not use Wubi as it sometimes drains battery faster than the standard install.

Also, keeping your drivers updates and installing most stable proprietary drivers helps.

Anyway, to install TLP use this:

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo tlp start
  • Duplicate http://askubuntu.com/questions/285434/jupiter-or-similar-power-saving-app-for-13-04 – Qasim May 08 '13 at 06:16
10

As I tell with all my clients with laptops - if you have a laptop make sure you are properly discharging and recharging your battery. This greatly extends the life of your battery.

Ubuntu has some great power saving options (System > Preferences > Power Management) Which will allow you to setup functions to help save your batteries life while away from A/C

Other things to take into consideration - if you're not using Bluetooth or Networking turn off those services (some Vendors even include hardware buttons for this) Dimming your Laptop Display is also a good way to conserve battery power. Lastly straying away (when possible) from CPU/GPU intensive operations will help to conserve battery power.

EDIT:

Usually it is said that Lithium ion battery has no memory effect. I read that a lot of times in several different places and chose to believe in it and charge my notebook battery randomly. Don't know if that is the reason, but in two years I ended up with a lousy battery (doesn't last more then 10/20 minutes). On the other side, for my smartphone I almost only recharge when the battery is around 5%, and after two years I almost can't notice any difference in the battery state. I would say it is good luck with the phone, but then I stumble across this article. It is a Nature publication and though I haven't read it all, it says that lithium ion battery do present a memory effect. So be aware that it is relevant to spare your battery of unnecessary charge cicles.

Marco Ceppi
  • 48,101
  • 2
    What do you mean by properly discharging and recharging? Different kinds of batteries require different things, but the most common kind, Lithium ion, require nothing more than running it on battery for a while at least once a month. – Ryan C. Thompson Aug 06 '10 at 18:12
  • 1
    Well as you mentioned each battery is different. So Lithium Ion's they usually recommend discharging the battery all the way to 0 once a month. As an example – Marco Ceppi Aug 06 '10 at 18:25
  • 4
    I think you may be confusing battery types here. What you said is true, I think, for nickel-cadmium batteries, not for lithium-ion ones. You should research the topic and (if necessary) edit your answer. – Stefano Palazzo Oct 29 '10 at 04:53
  • 1
    My two last laptops, both Dell, have a UEFI/BIOS feature that optimizes the use for always on AC (as I do always keep them plugged in). Normally, having the laptop always plugged in charges and discharges the battery too often, killing it fast. But with this setting, battery is just never used when charged and in AC, so it never discharges, so it has a much lower battery wear than other laptops. YMMV. – Nicolay77 Apr 03 '20 at 20:43
8

In addition to dimming the display, turning off bluetooth, etc. I sometimes use the CPU Frequency Scaling Monitor to limit the power my processor cores use. You can add it to a panel by right-clicking on a panel, selecting Add to Panel, and finding it in the list.

DLH
  • 2,445
  • 2
    It's worth noting that the “powersave” governor will counter-intuitively not necessarily be the most power efficient. Check out http://www.codon.org.uk/~mjg59/power/good_practices.html – RAOF Aug 05 '10 at 03:57
5

You can use the terminal app called powertop to find out what is making the cpu "wake up". simply install by doing sudo apt-get install powertop and then run by doing sudo powertop

3

The Ubuntu Kernel team has written some notes on how to save power here: https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks

Also, there are notes on how to identify applications and services that may be sucking power here: https://wiki.ubuntu.com/Kernel/PowerManagement/IdentifyingIssues

3

It might be a bit late, but I've just found this out myself. Just search for quiet splash in /boot/grub/grub.cfg and add pcie_aspm=force behind it. It lifted my battery life from 45 minutes to 1 and a half hour! :D

Be warned

On some systems (including my own), the pcie_aspm=force parameter kills the battery in the long run, to the point of it becoming practically useless (10 minutes on a full charge).

RobinJ
  • 8,910
  • See the brilliant phoronix article for info on this : http://www.phoronix.com/scan.php?page=article&item=linux_2638_aspm&num=2 – belacqua Sep 04 '11 at 04:19
  • From that file: DO NOT EDIT THIS FILE It is automatically generated by grub-mkconfig using templates from /etc/grub.d and settings from /etc/default/grub. If it is about 11.04 ;) – Rinzwind Sep 04 '11 at 07:02
  • 1
    Or you could indeed do it in /etc/default/grub and run update-grub xD Wich indeed may be a better idea xD GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force" – RobinJ Sep 04 '11 at 09:01
  • Be aware that pcie_aspm=force can cause some systems to lockup and become unresponsive. Not all hardware supports aspm. Ref: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/ASPM.html – dumbledore Sep 04 '11 at 02:17
3

Ubuntu provides simple power management under System -> Preferences -> Power Management. From there, you can configure what happens when running on battery versus on AC power, including screen brightness and sleep/hibernate modes. Tweaking these settings can give you improved battery life without having to install or configure any extra packages.

Kubuntu has similar options in System Settings -> Advanced -> Power Management.

3

To access power settings click on the battery icon in the status indicator and you can change power preferences.

There's also other tools like the gnome cpu-throttler applet if your cpu supports dynamic scaling. power-top can give you an insight into what the most power-hungry applications/services are...

i've also heard rumors, though seen no evidence myself, that the opensource graphics drivers for nvidia/ati do not support power-saving mode, which would lead to lower battery life. in this case, it might make sense (though i generally wouldn't recommend it) to use the proprietary graphics drivers for your system, as they may have better power-saving.

nathwill
  • 2,605
2

You can install bumblebee if you have an Optimus technology laptop with a nVidia GPU. It will extend your battery life to very good extent. To install it go to https://wiki.ubuntu.com/Bumblebee

It extended my battery life from 2.00 hours to 4.30 hours.

aquaherd
  • 6,220
2

If you are using an ATI graphics card change to the FLGRX driver. It runs a lot cooler with this driver and so uses a lot less power. There is a bug for this on launchpad.

trampster
  • 11,342
2

Turn down brightness and shut of wireless , leave screen saver as blank and lower the time when display shuts off on idle.

1

Are you running through wubi? I find that this makes Ubuntu run slower, lag more, and cause faster battery drains. I solved this by keeping my screen dimmest as possible, allowing it to dim to save power, keeping wifi switched off often and closing background programs.

Acey
  • 11
1

You could do something like this to limit cpu-speed

sudo -i
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

The applet constantly reads stats, not much but is still uses power ;) i often do this in the summer not because I'm away from the plug, but for not overheating my computer.

1

I have 2 hard drives - an SSD which stores / and a larger spindle for storage.

I set hdparm to spin down the storage drive after 10 minutes of inactivity. In /etc/hdparm.conf put e.g.:

/dev/sdb {
    spindown_time = 60
}

This works well because I mostly keep music & movies on the storage drive so when I'm in hardcore work mode I don't access it at all.

As well as saving power, this makes the laptop noticeably cooler and often the fan will turn off completely if I'm not doing anything too strenuous, giving completely silent running!

scottl
  • 2,588
0

A lighter desktop environment will use less power. Take a look at Ubuntu-supported "flavors" https://ubuntu.com/download/flavours and consider using a non-GNOME DE.

K7AAY
  • 17,202
0

Here is some simple tips I use to save my battery :

  1. Install TLP :

    sudo add-apt-repository ppa:linrunner/tlp
    sudo apt-get update
    sudo apt-get install tlp tlp-rdw
    sudo tlp start
    
  2. Disable Bluetooth at startup

    Using TLP

    sudo nano /etc/default/tlp
    

    Uncomment the following line :

    DEVICES_TO_DISABLE_ON_STARTUP=“bluetooth”
    

    Using Rc.local

    sudo nano /etc/rc.local
    

    Add the following before the line with exit 0 :

    rfkill block bluetooth
    
  3. Disable keyboard brightness

  4. Reduce screen brightness

  5. Disable networking when not using it (watching movie etc...)

hg8
  • 13,462
0

For laptops with two or more graphics cards, using the integrated one can save significant amounts of power.

For NVIDIA cards, going to PRIME Profiles and switching to Intel (Power Saving Mode) in nvidia-settings cut my power consumption in half and doubled my battery life.

qwr
  • 2,802
0

You can also use (for example from the Gnome menu-bar) the CPU widget, that offers scheduling options depending on your CPU.

wishi
  • 641
-2

if you want save battery life. click on the battery icon on the task bar then press power saver. really works. if ur gonna go somewhere your not going to use your internet switch if wifi and your internet connection. lower the screen brightness. mute the volume if your not gonna use volume . lower it or just mute it. don't put your laptop on something that's like a blanket bed dirty desk, etc. because these things can heat your laptop and make the fan work more so that will reduce battery energy too. hope this works!!! :)

Zalgo
  • 482
john
  • 1