36

I'm currently using this:

cpupower frequency-set --governor powersave

but it resets after each reboot.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Kyra
  • 501

3 Answers3

25

For 16.04 there's one more step to add to Jayen's answer. The complete set of steps are

sudo apt-get install cpufrequtils
echo 'GOVERNOR="powersave"' | sudo tee /etc/default/cpufrequtils
sudo update-rc.d ondemand disable

The last step disables the "ondemand" daemon, which would otherwise overwrite the changes created by cpufrequtils.

See also How I can disable CPU frequency scaling and set the system to performance?

You might also consider adding, for example, MAX_SPEED="2GHz" to /etc/default/cpufrequtils if you have an overheating, say, 2.2GHz processor, to limit the maximum possible speed.

14

To set the governor permanently to powersave, firstly install cpufrequtils:

sudo apt-get install cpufrequtils

And then edit the /etc/init.d/cpufrequtils file and change GOVERNOR to "powersave" (GOVERNOR="powersave"). You can do this automatically by using the following command:

sudo sed -i 's/^GOVERNOR=.*/GOVERNOR="powersave"/' /etc/init.d/cpufrequtils

From here: Prevent Your Laptop From Overheating With Thermald And Intel P-State

Alin Andrei
  • 7,348
  • 8
    Editing the /etc/init.d/cpufrequtils is the wrong approach because this file contains the following code: if [ -f /etc/default/cpufrequtils ] ; then . /etc/default/cpufrequtils

    Therefore the default governor should be set as follow. echo 'GOVERNOR="powersave"' | sudo tee /etc/default/cpufrequtils

    – caracal Oct 01 '18 at 18:59
  • thanks, you save me a lot of time! – Matthias Lenmher May 18 '23 at 16:50
14

Based on Alin's answer, but will persist when cpufrequtils is upgraded:

To set the governor permanently to powersave, firstly install cpufrequtils:

sudo apt-get install cpufrequtils

And then create/edit the /etc/default/cpufrequtils file (which is read from /etc/init.d/cpufrequtils) and set GOVERNOR="powersave". You can do this automatically by using the following command:

echo 'GOVERNOR="powersave"' | sudo tee /etc/default/cpufrequtils

And if you are on Ubuntu 16.04 or later, you need to disable the built-in service that sets the governor to ondemand:

sudo update-rc.d ondemand disable
Jayen
  • 395
  • There I am posting last step for Ubuntu 18.04 or later: And if you are on Ubuntu 18.04 or later, you need to disable the built-in service that sets governor to ondemand: sudo systemctl disable ondemand – luke Aug 13 '22 at 13:23