This quick tutorial shows you how to check the CPU temperature on Ubuntu and other Linux distributions with a help of a tool called Psensor.
Overheating of laptops is a common issue one faces these days. Monitoring hardware temperature may help you diagnose why your laptop is getting overheated. In this article, we’ll learn how to check the CPU temperature on Ubuntu.
Check CPU temperature in Linux command line
You can check the CPU temperature using a command line utility called sensors. Combine it with the watch command to keep on monitoring the CPU temperature in the terminal like this:
watch -n 2 sensors
If your distribution doesn’t have sensors command installed already, you can use your distributions’ package manager to install either sensors or lm-sensors package.
You can see the CPU temperatures refreshed for each core every two seconds:
Every 2,0s: sensors iwlwifi-virtual-0 Adapter: Virtual device temp1: +39.0°C acpitz-virtual-0 Adapter: Virtual device temp1: +27.8°C (crit = +119.0°C) temp2: +29.8°C (crit = +119.0°C) coretemp-isa-0000 Adapter: ISA adapter Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C)
That was easy, wasn’t it? Let’s see how to do it graphically.
Check CPU temparature with Psensor GUI tool
We’re going to use a GUI tool, Psensor, that allows you to monitor hardware temperature on Linux. With Psensor you can:
- monitor the temperature of the motherboard and CPU sensors
- monitor the temperature of the NVidia GPUs
- monitor the temperature of the hard disk drives
- monitor the rotation speed of the
fans monitorCPU usage
The latest version of Psensor also provides an applet indicator for Ubuntu and thus it makes the monitoring of hardware temperature even easier on Ubuntu. You can choose to display the temperature right in the top panel itself. It can even send a desktop notification when the temperature exceeds the limit.
Install Psensor on Ubuntu 18.04 and 16.04
Before you install Psensor, you need to install and configure lm-sensors, a command-line utility for hardware monitoring. If you want to measure hard disk temperature, you need to install hddtemp as well. To install these tools, run the following command in a terminal:
sudo apt install lm-sensors hddtemp
Then start the detection of your hardware sensors:
To make sure that it works, run the command below:
It will give you an output like:
Adapter: Virtual device
temp1: +43.0°C (crit = +98.0°C)
Adapter: ISA adapter
Physical id 0: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +41.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +40.0°C (high = +100.0°C, crit = +100.0°C)
If everything seems alright, proceed with the installation of Psensor by using the command below:
sudo apt install psensor
Once installed, run the application by looking for it in the Unity Dash. On the first run, you should configure which stats you want to collect with Psensor.
Display temperature in the panel
If you want to show the temperature in the top panel, go to Sensor Preferences:
Then under the Application Indicator menu, select the component for which you want to display the temperature and then check the Display sensor in the label option.
Start Psensor at each startup
Go to Preferences->Startup and then check Launch on session startup to start Psensor at each boot.
That’s it. Everything you need for monitoring and checking your CPU temperature is here. You can keep an eye on it and it may help you find out which process is overheating your computer.
If you prefer the command line, you can use a few commands to monitor the GPU and CPU temperature in the Linux terminal. There are terminal based tools like s-tui as well that let you monitor CPU utilization in a fancy way.
However, do note that it’s often the hardware that causes overheating. If you use a desktop computer, you should regularly clean it. You can refer to this article about reducing CPU temperature.
I hope you find this article useful. Please take a moment to share the article on social media, Hacker News and other such websites. Thank you.