In this post, I am going to discuss how you can check CPU temperature in Linux.
I tested this on Ubuntu 22.04 (LTS). It is working properly. Hope this will also work for all Debian based distributions.
Note: This will work only on the physical system. I have tested this on the cloud instance (AWS & Digital Ocean), and it did not work.
Step 1: Log in to your server and run this command. (No need to add sudo if you have root access)
sudo apt update && apt upgrade -y
Step 2: Now we need to install lm-sensors. To do that type the below command.
sudo apt install lm-sensors
Next, you need to detect hardware monitoring chips installed on your system.
Step 3: Type the following command.
sudo sensors-detect
If everything is okay then the command will appear with YES/No, just type YES to continue.
Now, Load the module using the below command if you did not get any errors.
/etc/init.d/kmod start
Your installation is done successfully. Type the below command to check CPU temperature.
sensors
You can also type watch sensors to check live CPU temperature (Ctrl + C to exit).
Comment below if you get any errors.
Hi,
Thank you for the post. I was searching everywhere to do this for my home server. Now got the solution.
Hi John, Thank you for the comment.