Keep in mind most websites suggest leaving CPU governing at Powersave. I'm on a laptop and found using Intel's ThermalD and P-State technologies coupled with TLP power management has best result for frequencies, fan speed and temperature.

Summarizing above links

To summarize achieving your goal from the above answers use:

Install cpufrequtils:

sudo apt-get install cpufrequtils

Then edit the following file (if it doesn't exist, create it):

sudo nano /etc/default/cpufrequtils

And add the following line to it:

GOVERNOR="performance"

Save and exit.

For changes take effect, run:

sudo /etc/init.d/cpufrequtils restart

Then you can run cpufreq-info to see informations about your cpu frequency, governor and more:

$ cpufreq-info
current policy: frequency should be within 800 MHz and 3.90 GHz.
The governor "performance" may decide which speed to use
within this range.

I'm on Xubuntu 18.04.02 LTS and installing cpufrequtils by sudo apt-get install cpufrequtils, made it possible to reduce the max CPU-speed. A nice option to have as the fan has stopped working.

After looking at the info by cpufreq-info, I created a file by sudo nano /etc/default/cpufrequtils, and wrote into it as in picture below. I found out it was of use to also set a value for min speed.

Lastly the command to make the change take action sudo /etc/init.d/cpufrequtils restart, resulting in this output from cpufreq-info:

To be clear - this is off course not my own findings, only a result of conclusions made from other earlier questions, comments, and answers on this forum. Especially the answer in this very question from
WinEunuuchs2Unix.