Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to set the CPU frequency scaling governor for all cores at once instead of doing it individually for each core. Is there a way to do this?

(I know it would be easy to echo the governor to /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor, but I'm not looking for a custom solution.)

share|improve this question
With "custom solution" you mean that a shell script is unacceptable, it needs to be a built-in GUI button? – j-g-faustus Jan 6 '11 at 16:09
I'm just wondering if there already exists a solution in a standard installation (doesn't need to have a GUI). – htorque Jan 6 '11 at 16:20
Check this page: under "debian implementation": It is apparently possible to change the boot default, and there is a userspace tool called powernowd. (This is a comment rather than reply because the post is from 2008, and I haven't tested if it still works...) – j-g-faustus Jan 6 '11 at 22:47

I'm still a linux noob but don't you think cpufrequtils lets u do it by using (its not bundled in the Ubuntu OS but is there in the repository)

sudo apt-get install cpufrequtils
cpufreq-set -r -g performance #-r for related (all) the cores
share|improve this answer
@htorque What prevents you from installing the cpufrequtils package? – Marco Mar 6 '12 at 15:42
The -r related option doesn't do it for all the cores. We have to specify the cpu number with option -c <number> however this script will do it for all cpus in one go: for ((i=0;i<$(nproc);i++)); do cpufreq-set -c $i -r -g performance; done – Sri Sep 11 '14 at 9:50
Exactly, @Sri is right. cpufreq-set in fact lacks of ultimately simple but needed functionality. Lots of people as this vote counters clearly shows are just not aware of it because its description is simply misleading to top it off. – poige Oct 27 '15 at 16:43
up vote 11 down vote accepted

I googled a lot and I think it's just not possible, so I added the following one-liner to my .bashrc:

function setgov ()
    echo "$1" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 

Now I can run something like setgov ondemand and all cores will switch to the ondemand governor.

share|improve this answer
This doesn't work as the file scaling_governor is owned by root and has restricted permissions. Changing the permissions is not always recommended. – Sri Sep 11 '14 at 9:16
Please see alternative script in my comment to user49449's answer. – Sri Sep 11 '14 at 9:53

Check out Jupiter:

It's a power mgmt daemon that runs in the background and will govern your cores on-demand.

share|improve this answer
jupiter has been discontinued. – Volker Siegel Jul 9 '14 at 0:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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