How to check CPU temperature on Linux
On Linux, if your CPU is running hot, you won’t be able to open up an official AMD or Intel utility to check the temperature. Instead, to check CPU temperature on Linux, you must rely on third-party programs. In this guide, we’ll go over some ways to check the CPU temperature on Linux.
Using Lm_Sensors
Lm_Sensors is a command-line utility that can be set up to scan various hardware sensors on a Linux PC to report temperature status. Lm_Sensors is a useful tool to use to check your CPU’s temperature in a pinch.
No Linux distributions currently come with Lm_Sensors, so before we go over how to use it, we must demonstrate how to install the program on your Linux PC.
To start the installation, open up a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard. From there, follow the command-line instructions down below that correspond with your Linux operating system.
Ubuntu
On Ubuntu, the Lm_Sensors application is easily installed with the Apt command below.
sudo apt install lm-sensors
Debian
Using Debian Linux? You’ll be able to install the program with the following Apt-get command.
sudo apt-get install lm-sensors
Arch Linux
The Lm_Sensors application is available to Arch Linux users in the “Extras” software repository. Ensure that “Extra” is enabled on your Arch system. Then, use the following Pacman command to get it set up.
sudo pacman -S lm_sensors
Fedora
To install Lm_Sensors on Fedora Linux, use the Dnf command below to set up the program on your system.
sudo dnf install lm_sensors
Configuring Lm_Sensors
After installing the Lm_Sensors application, the initial setup process isn’t done. Before using the app, it must be set up to work with the hardware sensors on your computer.
To start the configuration process, go to the terminal window and gain root access with the su or sudo -s command.
su
or
sudo -s
With root available, run the sensors-detect command in the terminal, and the initial configuration process will begin.
sensors-detect
The first screen that appears in the sensor configuration process says, “Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe“.
Write out “Yes” in the prompt to begin.
After selecting “YES,” the next question will appear. This question states, “Some Super I/O contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors?”
Once again, choose “Yes” to allow Lm_Sensors to scan.
Following the two main questions, the program will ask several other ones. Say yes to the questions asked where the word “yes” is in all caps, and no to the ones where the word “no” is in all caps.
When Lm_Sensors is done asking questions, the configuration is complete.
Check CPU temperature with Lm-Sensors
Checking CPU temperature on Linux with Lm-Sensors is done with the sensors command. To quickly check the temperature readout of your CPU (and other devices that Lm-Sensors detected), open up a terminal window with Ctrl + Alt + T or Ctrl + Shift + T on the keyboard.
Then, run the sensors command to view a readout of various sensor temperatures.
sensors
Alternatively, if you’d like to save your CPU temperature readout to a text file to read for later, run the sensors command and redirect it with the “>” symbol.
sensors > cpu-temp.txt