36

I'm currently using this:

cpupower frequency-set --governor powersave

but it resets after each reboot.

1

3 Answers 3

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.

5
  • how to revert this change?
    – techvish81
    Aug 25, 2017 at 10:24
  • 2
    Can you still switch to the ondemand governor temporarily, using cpufreq-set, after disabling it with update-rc.d?
    – Xen2050
    Dec 22, 2017 at 23:15
  • Did you mean "override" or "overwrite" the changes created by cpufrequtils? I believe it should be former.
    – Jus12
    Dec 10, 2019 at 13:02
  • 1
    Note, for ubuntu 18.04+ use sudo systemctl disable ondemand to disable ondemand Dec 2, 2021 at 18:32
  • This is not recommended because the file may already exist, so you'd a second line of GOVERNOR=
    – Freedo
    Feb 4, 2022 at 7:08
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

1
  • 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 1, 2018 at 18:59
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
1
  • 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, 2022 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.