Force Set CPU Frequency on Linux

So I have had to disable the CPU frequency scaling in a recent project. I found that it isn’t as straightforward in Ubuntu 16.04 anymore, because of Intel’s p_state.

Thus, if you want to explicitly set the frequency of the CPU, you now need to disable p_state to go back to ACPI cpufreq.

First, we want to modify grub and update the line:

such that it now reads:

Next, let’s update grub by:

After restarting the computer, you should be able to see that /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors now exists again.