This article will explain why CPU temperature monitoring is important and how to check CPU temperature on a Linux machine.
Why Should I Monitor My CPU Temperature?
CPU or the Central Processing Unit is the main component of a computer system responsible for processing the data. The temperature of the CPU solely depends on the processes and applications running on your operating system. Overheating, in general, can cause instability and unexpected shutdowns.
If not given enough attention, an overheated CPU can cause permanent damage to your computer system, forcing you to change specific components or replace the entire computer.
How to Check CPU Temperature on Linux
Several applications are available on a Linux system that display intricate details of the CPU. You will be able to check your CPU’s temperature using such utilities.
Get Hardware Information Using Glances
Glances is a cross-platform real-time system monitoring tool written in the Python language. This application provides information using the psutil library on Linux. Apart from CPU-related data, you can also check Load Average, Memory, Network interfaces, Disk I/O, file system, and processes.
You can install Glances on your Linux machine using either curl or wget:
The auto-install script doesn’t support some specific distributions like Manjaro Linux. Luckily, Glances is also available as a snap package on SnapStore.
After installing the package, start the utility by typing glances in your system terminal.
Glances will start displaying system-related information in real-time. Press the S key on your keyboard to toggle sensor details.
Analyzing Sensor Information Using the sensors Utility
Another tool to get CPU temperature on Linux is sensors. Sensors is a command-line utility that displays sensor chip readings in real-time. While some distributions such as Ubuntu ship with sensors preinstalled, it can be installed on other distros as well using the default package manager.
On Debian-based distributions:
To install sensors on Arch-based distributions:
On Fedora and RPM distributions:
Once the package is installed, run the following command to detect sensor chips present in your system.
Run the application by typing sensors in your system terminal. You will get hardware information on your computer’s CPU temperature.
Display CPU Temperature Using HardInfo
As the name suggests, HardInfo is a simple Linux utility used to gather hardware information including the CPU temperature.
You can install HardInfo on Debian-based OSes using apt:
On Arch-based distros:
To install on Fedora and RPM:
After installing the package, you can view the hardware information using the following command.
In the output, scroll down to the Sensors section to get complete information on the CPU temperature.
HardInfo is also available as a GUI app. To launch the GUI app, go to the Applications Menu and click on the HardInfo icon.
Alternatively, you can type hardinfo in the terminal to start the application.
Get CPU Information With i7z
If your computer runs on an Intel processor, then i7z is probably the best command-line utility to get temperature-related information about your system.
You can easily install i7z on Debian using apt.
On Fedora and RPM:
To install i7z on Arch-based Linux distributions:
In your system terminal, type sudo i7z and press Enter to launch the utility. Detailed CPU information including temperature, number of cores, frequency, etc. will be displayed.
Increasing the Life of Your Linux Machine
Maintaining an appropriate CPU temperature can have a positive effect on your system’s health. Many a time, overheating can even lead to fire and explosion in your cabinet, not to mention the damage caused to the components in the process.
You can prevent overheating on your system to some extent. But in the long run, having a proper cooling system and ventilation is the most suitable choice.