How to Reduce Fan Noise (Fan Speed Control) on Ubuntu Desktop

This tutorial will be showing you how to reduce fan noise on Ubuntu desktop computers, because who doesn’t want a quiet computer? Your brain can think more clearly in a quiet environment.

This tutorial is based on my own computer and because I have only one desktop computer, the information in this article might not be thorough and complete, and sometimes you might need to adapt it to your own computer hardware.

CPU Frequency Control

Rule of thumb:

Higher CPU frequency  --->  Higher CPU Tempature  --->  Faster Fan Speed  --->  Louder Noise

Computer fans rotate faster when CPU frequency is higher. If you set a limit on CPU frequency, then the fans won’t suddenly become very loud. My CPU can reach 4.5 GHz under high system load, but actually, I don’t need the CPU to work that faster, because many of the processes on my computer are running on the background. It’s good to finish the tasks faster on the background, but it has little to no impact on the foreground tasks, if you are not doing video production, graphic design, or playing games.

We can use a graphical tool called cpupower-gui to set the scaling frequencies and governor of a CPU. Run the following command to install it from the default Ubuntu software repository.

sudo apt install cpupower-gui

Then you can launch cpupower-gui from your application menu. It’s very simple to use. Set a max frequency, for example 2GHz, and click the apply button. You can toggle on All CPUs, so the setting will apply to all CPUs.

CPU frequency settings

If you set a low value for max frequency, your CPU usage will go up. So don’t set the max frequency too low, or your computer might freeze during high system load.

There are two governors for CPU:

  • Performance
  • Powersave

I mostly use the computer for web browsing and doing system administration in the terminal. There’s no CPU demanding applications on my computer, so I set the Governor to Powersave.

Usually when I restore many tabs in Firefox, my CPU would go crazy and the fans become very noisy. Now I limit the CPU frequency to 2GHz, the fans speed stay the same. You can check the current CPU frequency with:

lscpu

lscpu check cpu frequency

It’s not convenient to run lscpu every time you want to check CPU frequency. You can use a system indicator called indicator-multiload.

sudo apt install indicator-multiload

Then you can start it from your application menu by searching system load indicator. Go to Preferences -> Indicator Items, and add a new entry. Enter freq $(frequency(cpufreq.cur1)) as the value. Move this entry to the top. Then close the window.

indicator-multiload

Now you can see the current CPU frequency on the taskbar.

cpu frequency indicator ubuntu

Auto-Start

The frequency setting in cpupower-gui will be lost after system reboot. You can enable it to auto-start at boot time. Launch the startup applications on Ubuntu, and add a new entry.

Startup Applications cpupower-gui

Enter the following information:

  • Name: cpupower-gui
  • Command: /usr/bin/cpupower-gui

cpupower-gui autostart

Click the Add button and you’re done.

Setting Max CPU Frequency From Command Line

Install the following packages.

sudo apt install linux-tools-generic linux-tools-common linux-tools-$(uname -r)

Then you can set max CPU frequency with:

sudo cpupower frequency-set --max 2000MHz

By default, the setting is applied on all cores.

The CPU frequency setting will be lost after system reboot. To automatically set the max CPU frequency, we can create a systemd service with the Nano command-line text editor.

sudo nano /etc/systemd/system/cpupower.service

Add the following lines in this file.

[Unit]
Description=Set Max CPU Frequency
After=systemd-user-sessions.service [email protected] plymouth-quit.service

[Service]
Type=oneshot
ExecStart=cpupower frequency-set --max 2000MHz

[Install]
WantedBy=multi-user.target

Save and close the file. Press Ctrl+O, then press Enter to save the file. Press Ctrl+X to exit.

Then enable this service to start at boot time.

sudo systemctl enable cpupower

Fan Speed Control

You can control the fan speed based on CPU temperature.

Install the following software from the default Ubuntu repository.

sudo apt install fancontrol lm-sensors psensor
  • fancontrol: utility to control the fan speed
  • psensor: hardware temperature monitor
  • lm-sensors: utilities to read temperature/voltage/fan sensors

Next, run the following command to detect hardware monitoring chips, aka sensors.

sudo sensors-detect

It will ask you several questions. You can press Enter to choose the default answer (YES).

sudo sensors-detect

At the end of the probe, you will get a list of kernel modules that you need to add to /etc/modules file. You can answer yes so they will be automatically added.

coretemp Intel digital thermal sensor

Then run the following command to restart kmod.service, so the newly-added kernel modules can be loaded.

sudo systemctl restart kmod

Now we can configure fan speed profiles.

sudo pwmconfig

pwmconfig will attempt to stop your fans, one at a time, for approximately 5 seconds each. So you should run it after setting a max frequency for your CPU as described earlier and when the system load is low. Close other programs to reduce system load.

sudo pwmconfig

After the above command is completed, restart fancontrol.

sudo systemctl restart fancontrol

The term “PWM” is used because most fan control systems in computers are based on pulse width modulation. Some motherboards use DC variation instead. So, the term “PWM” should be seen
as a generic term for “fan speed control”, regardless of the actual method used.

Control Fan Speed in UEFI Firmware

Your UEFI firmware might have built-in fan control. Controlling fan speed in UEFI firmware is usually the most reliable method, as it’s a low-level hardware setting that works independently of your operating system. For example, my ASUS motherboard allows me to select from available pre-set profiles like Silent, Balanced, Performance, or Quiet. I can even turn off the chassis fan completely, as it’s very noisy. 

Rate this tutorial
[Total: 0 Average: 0]

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here