Monitoring temperature is essential for systems that get overheated when you run certain applications. Overheating causes various issues, it can damage the hardware components such as hard disk, video cards, motherboard, etc.
Overall the higher temperature decreases the lifespan of a computer system. There are various software tools that can be used to read the temperature of a system, here we are going to discuss the same for Linux.
In this article, I will discuss how to monitor CPU temperature on Ubuntu Linux.
Prerequisites
To follow this guide you should have the following –
- A system running Ubuntu Linux
- To install the required package you should have access to a user account with superuser privileges.
How to install lm-sensors package in Ubuntu
The sensors command is a simple command-line tool that reads the temperature measured by the sensor chip which comes included in your system.
Now before you install a package make sure the apt package repository is updated –
sudo apt update
By default, lm-sensors come preinstalled in various distributions but if it is not in your system then run the given command to install it –
sudo apt install lm-sensors
Once the above package gets installed, use the given command to detect all sensors on your system –
sudo sensors-detect
Every time enter yes and then press enter key if the above command prompts you for the detection of new sensors. After the above command finishes detecting all the sensors next run the given command to see the CPU temperature.
sensors
As you can see the above output shows the temperature of different cores of the CPU, voltage, and current in the CPU.
Reading temperature of the hard disk using hddtemp
The hddtemp command reads and displays the current temperature of your hard disk. First, you need to install hddtemp package to run this command.
Run the given command to install hddtemp on your system –
sudo apt install hddtemp
Press y and then enter if it asks for your confirmation.
Now use the command as it is given below to read the temperature of your hard disk –
sudo hddtemp /dev/sda
Reading the temperature of NVMe SSD
If you are using SSD then you need a separate command to display the temperature. Use the given command to install nvme-cli package –
sudo apt install nvme-cli
Next, run the given command to display the list of nvme SSD on your system –
sudo nvme list
Finally, use the given command to display the temperature of the SSD –
Conclusion
There are so many other tools like psensor, glance, etc that can be used to display CPU temperature. Now we hope you are able to monitor the temperature of your Ubuntu system.
Now if you have a query or feedback then write us in the comments below.