4 Useful Tools to Monitor CPU and GPU Temperature in Ubuntu

The CPU or GPU temperature depends entirely on the usage of running programs or applications. Sensitive computer components such as CPUs have a finite lifespan and running them at a temperature that exceeds a certain limit (or at higher temperatures generally) can shorten it. Besides, it can also cause thermal throttling especially when the fan is not providing adequate cooling.

Recommend Read: 10 Useful Commands to Collect System and Hardware Information in Linux

So it is important to monitor your system’s CPU temperature to avoid damaging it as a result of overheating. In this article, we will share some useful command-line tools to help you keep a close eye on the temperature of your CPU and GPU.

1. Glances

Glances is a cross-platform, advanced and popular real-time system monitoring tool that uses the psutil library to gather information from various system resources.

It can display information from sensors using the psutil and/or hddtemp tools. One of its intriguing features is the webserver mode which allows you to access it via a web browser to remotely monitor your Linux server.

There are various methods to install Glances on your system, but the preferred way of installing glances is using an auto-install script, which will install the latest production-ready version.

To install Glances on your system, use curl or wget command as shown.

# curl -L https://bit.ly/glances | /bin/bash
OR
# wget -O- https://bit.ly/glances | /bin/bash

Once you have installed it, start Glances and press f key to view sensors information.

# glances
Glances - Monitor CPU and GPU Temperature
Glances – Monitor CPU and GPU Temperature

2. Sensors

Sensors is a simple command-line utility that displays the current readings of all sensor chips including the CPU. It comes pre-installed some Linux distributions such as Ubuntu by default, otherwise install it as shown.

$ sudo apt-get install lm-sensors

Then you can run the following command to detect all sensors on your system.

$ sudo sensors-detect
Detect Sensors in Linux
Detect Sensors in Linux

Once detected, you can run the following command to check CPU temperature, GPU temperature, fan speed, voltage, etc.

$ sensors
Sensors - Show CPU and GPU Temperature
Sensors – Show CPU and GPU Temperature

Recommended Read: Psensor – A Graphical Hardware Temperature Monitoring Tool for Linux

3. Hardinfo

Hardinfo is a lightweight system profiler and benchmark tool designed for hardware analysis and report generation. It features comprehensive reports on system hardware and allows for the generation of HTML reports on your system’s hardware.

To install the hardinfo package on your Ubuntu Linux system, run the following command.

$ sudo apt install hardinfo

After the installation is complete, you can launch hardinfo to view devices’ information by running the following command.

$ hardinfo -rma devices.so
View Device Information in Linux
View Device Information in Linux

To launch the GUI app, simply run the following command or search for ‘System Profiler and Benchmark’ in the system menu or Dash and open it.

$ hardinfo

Then click on sensors to view sensors information as shown in the following screenshot.

View Sensors Information in Ubuntu
View Sensors Information in Ubuntu

4. i7z

i7z is a tiny command-line utility that reports Intel Core i7, i5, i3 CPU information including temperatures. You can install it on your Ubuntu system by running the following command.

$ sudo apt install i7z

Once installed, run i7z with root privileges as shown.

$ sudo i7z
Show Intel Core Information with Temperature
Show Intel Core Information with Temperature

You might also like to read these useful related articles.

  1. Limit CPU Usage of a Process in Linux with CPULimit Tool
  2. 9 Useful Commands to Get CPU Information on Linux
  3. Cpustat – Monitors CPU Utilization by Running Processes in Linux
  4. CoreFreq – A Powerful CPU Monitoring Tool for Linux Systems

That’s all for now! In this article, we have shared the useful command-line tools for viewing CPU and GPU temperatures in a Ubuntu system. Have your say about this article or ask questions via the feedback form below.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

11 thoughts on “4 Useful Tools to Monitor CPU and GPU Temperature in Ubuntu”

    • None of these work in Debian 11.6, all refer to python-dev and that is no longer “good“.

      I get a message||

      $ sudo wget -O- https://bit.ly/glances | /bin/bash
      

      Redirecting output to ‘wget-log.3’.
      Detected system: Debian
      sudo apt-get install -y python3-pip python-dev python3-docker gcc lm-sensors wireless-tools
      Reading package lists… Done
      Building dependency tree… Done
      Reading state information… Done
      Package python-dev is not available, but is referred to by another package.
      This may mean that the package is missing, has been obsoleted, or
      is only available from another source
      However the following packages replace it:
      python-dev-is-python3

      E: Package ‘python-dev’ has no installation candidate

      Reply
  1. At least in the current version of glances, the button for sensor data is 's' not 'f', ‘f’ is filesystem.

    Reply
  2. One “trick” I use with the ‘sensors‘ command is to combine it with the ‘watch‘ command in a dedicated terminal window:

    $ watch sensors
    

    This will refresh every 2 seconds (the watch default). I resize the window to just fit the data and alt-tab to it when I want to see my system/cpu temps at a glance.

    You can change the interval time on the watch command:

    $ watch -n 4 sensors
    

    It every 4 seconds, etc.

    Reply
  3. I use Hardinfo for many things like identifying hardware and systems or identifying boot problem, but for constant temp readouts in C or F I use a GUI, GKrellM system monitor.

    Reply
  4. These utilities can be installed and used perfectly well in almost all Linux distributions, not just Ubuntu. You have also written articles about packages that are available only in Ubuntu PPAs and declared them usable in all of Linux.

    You, and many others, have a penchant for making Ubuntu sound like the only Linux distro in existence. Ubuntu IS NOT the alpha and omega of Linux. It is not even close to being the most popular distro.

    How about some truth in labeling? If the article is distro-specific, say so in the title. If the article is not distro-specific, says that in the title. You will not lose readers. In fact, you may gain them.

    Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.