1. Home
  2. Linux
  3. Check cpu temperature on linux

How to check CPU temperature on Linux

Your CPU (central processing unit) is the control center for your computer. As it works, it creates heat. Too much heat can cause hardware failure, sluggish responses, and performance problems. Checking your CPU temperature on your Linux system is helpful to be sure it’s running at optimal levels. If it is running hot, you can use third-party programs or specific command line inputs to check the temperature. We’ll show you step by step what to do. Keep in mind, that your particular Linux distribution will determine the exact commands to use, so do your research. There are dozens of them.

Method 1 – Lm_Sensors

Lm_Sensors is a useful command-line utility that can scan various hardware sensors on a Linux PC to report temperature status. If you don’t have it already, here’s how to install the program:

  1. Open a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T on the keyboard
  2. From there, follow the command-line instructions below that correspond with your Linux operating system

Ubuntu

Apt (Advanced Package Tool) is an interactive command-line utility used to update, remove, manage, and install packages in various Linux distributions. 

On Ubuntu, install the Lm_Sensors application with this Apt command:

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

OpenSUSE

Officially, OpenSUSE doesn’t carry the Lm_Sensors application. However, it should be possible to install the Fedora Linux Package.

Warning: the Fedora version of Lm_Sensors may not work on OpenSUSE Linux. Try this method at your own risk!

wget https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/30/Everything/x86_64/os/Packages/l/lm_sensors-3.5.0-3.fc30.x86_64.rpm
sudo zypper install lm_sensors-3.5.0-3.fc30.x86_64.rpm

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.

  1. 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
  2. With root available, run the sensors-detect command in the terminal, and the initial configuration process will begin.
    sensors-detect
    
    
  3. 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“.
  4. Write out “Yes” in the prompt to begin.
  5. 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?”
  6. Once again, choose “Yes” to allow Lm_Sensors to scan.
  7. 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.
  8. 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

Method 2 – Psensor

Another great way to check CPU temperatures on Linux is with the Psensor tool. It’s a graphical application that can show various sensor statistics in an easy to read interface.

Note: Psensor uses Lm_Sensors for some operations in the app. To get the most out of Psensor, follow the instructions in Method 1 to set up Lm_Sensors before following the instructions outlined below.

Install Psensor

  1. To install Psensor on Linux, open a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T
  2. Once the window is open, follow the command-line instructions below that correspond to the Linux OS you use

Ubuntu

sudo apt install psensor

Debian

sudo apt-get install psensor

Arch Linux

sudo pacman -S psensor

Fedora

sudo dnf install https://raw.githubusercontent.com/rpmsphere/x86_64/master/p/psensor-1.2.0-5.1.x86_64.rpm

OpenSUSE

There’s no package for Psensor available on OpenSUSE. Instead, try installing the Fedora Linux version but, use it at your own risk!

wget https://raw.githubusercontent.com/rpmsphere/x86_64/master/p/psensor-1.2.0-5.1.x86_64.rpm
sudo zypper install psensor-1.2.0-5.1.x86_64.rpm

Using Psensor to check temps

Once the Psensor app is installed, it doesn’t need configuring (outside of setting up Lm_Sensors). To check the CPU temperature, open the app, and look to the column on the right for the data.

Conclusion

Depending on your Linux distribution and the age of your system, there are several ways to track your CPU temperature. Your best bet, if the tips already covered didn’t help, is to research your specific parameters, as methods change all the time. For instance, mate-sensors-applet, the /sys/class directory, the acpi utility, or the watch sensors command are just some alternative ways to monitor temperatures. So research specific distros and the available approaches and applications.

6 Comments

  1. Hi there, for Fedora install, the updated version of psensors is available at:

    https://raw.githubusercontent.com/rpmsphere/x86_64/master/p/psensor-1.2.1-1.x86_64.rpm

    Regards

  2. On openSUSE I didn’t have to install anything. Typing “sensors” did just work out of the box.

  3. Hay, I realy like your articles. I’ve been using Linux now sence Oct. of 2019 and I realy like it. I have to Windows for a couple of things but otherwise I use Ubuntu for my daily driver. I installed Ubuntu on my DELL imspiron 5447 and it runs great.

    Thank you guys for all that you do, you’ve helped me a lot!!