Wiki source code of How to check CPU temperature on Ubuntu Linux
Version 1.1 by Сергей Коршунов on 2022/06/16 09:31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | How do I check CPU temperature in Ubuntu Linux using a command line and GUI tools on my Thinkpad laptop or Desktop computer? | ||
2 | \\One of the most common complaints is the overheating laptop, especially older models. Laptop components are tightly put together to each other. So there is very little room for air movement in thinner laptops. If your laptop overheats, it can cause some damage to your body as well as the hardware parts. Therefore monitoring hardware temperature is essential. In this tutorial, you will learn how to check CPU temperature in Ubuntu Linux. | ||
3 | |||
4 | |=(% colspan="2" %)Tutorial details | ||
5 | |Difficulty level|[[Easy>>url:https://www.cyberciti.biz/faq/tag/easy/]] | ||
6 | |Root privileges|[[Yes>>url:https://www.cyberciti.biz/faq/how-can-i-log-in-as-root/]] | ||
7 | |Requirements|Linux terminal | ||
8 | |OS compatibility|[[Debian>>url:https://www.cyberciti.biz/faq/category/debian-ubuntu/]] • Mint • Pop!_OS • [[Ubuntu>>url:https://www.cyberciti.biz/faq/category/ubuntu-linux/]] | ||
9 | |Est. reading time|4 minutes | ||
10 | |||
11 | Advertisement | ||
12 | |||
13 | == Procedure for monitoring CPU and HDD temperatures on Ubuntu == | ||
14 | |||
15 | 1. Open the terminal application. | ||
16 | 1. Install the lm-sensors and hddtemp packages in Ubuntu using the following command: | ||
17 | **sudo apt install hddtemp lm-sensors** | ||
18 | 1. Run **hddtemp** command to see SSD and hard drive temperature in Ubuntu. | ||
19 | 1. Execute **sensors** command to find out CPU temperature in Ubuntu Linux. | ||
20 | |||
21 | Let us view processor temperature including SSD/HDD in details for Ubuntu desktop or server with configurations. | ||
22 | |||
23 | == Check CPU temperature in Ubuntu Linux == | ||
24 | |||
25 | The sensors command is used in Linux to show the current readings of all sensor chips including CPU temp. The hddtemp command will show you the temperature for SSD and HDD. You need to install and configure the lm-sensors package as well as hddtemp. You can search it using the following syntax: | ||
26 | apt-cache search lm-sensors | ||
27 | apt-cache search hddtemp | ||
28 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/Check-CPU-and-HDD-temp-packages-in-Ubuntu-Linux.png||alt="Check CPU and HDD temp packages in Ubuntu Linux" height="424" width="599"]] | ||
29 | To install these packages on Ubuntu, run the following [[apt command>>url:https://www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/?utm_source=Linux_Unix_Command&utm_medium=faq&utm_campaign=nixcmd]] or [[apt-get command>>url:https://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html?utm_source=Linux_Unix_Command&utm_medium=faq&utm_campaign=nixcmd]] in a terminal: | ||
30 | sudo apt update | ||
31 | sudo apt upgrade | ||
32 | |||
33 | === Install lm-sensors in Ubuntu Linux === | ||
34 | |||
35 | Type the following [[apt command>>url:https://www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/?utm_source=Linux_Unix_Command&utm_medium=faq&utm_campaign=nixcmd]]: | ||
36 | sudo apt install lm-sensors | ||
37 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/How-to-install-lm-sensors-on-Ubuntu-Linux.png||alt="How to install lm-sensors on Ubuntu Linux" height="450" width="599"]] | ||
38 | Next you need to detect hardware monitoring chips installed in your laptop. Hence, start the detection of your laptop hardware sensors that will provide information about: | ||
39 | |||
40 | * Sensors embedded in CPUs and other super I/O chips | ||
41 | * Hardware monitoring chips accessed through I/O ports and SMBus/I2C bus on your system | ||
42 | |||
43 | Type the following command: | ||
44 | sudo sensors-detect | ||
45 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/Ubuntu-Linux-detect-hardware-monitoring-chips.png||alt="Ubuntu Linux detect hardware monitoring chips" height="321" width="599"]] | ||
46 | |||
47 | === Display CPU temperature in the command line === | ||
48 | |||
49 | Execute the following command: | ||
50 | sensors | ||
51 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/See-CPU-temperature-in-Ubuntu-Linux-using-the-command-line-option.png||alt="See CPU temperature in Ubuntu Linux using the command line option" height="543" width="599"]] | ||
52 | One can use the watch command command to run sensors command repeatedly, displaying its output on screen: | ||
53 | watch sensors | ||
54 | |||
55 | === How can I show the CPU temperature in the GNOME panel === | ||
56 | |||
57 | |||
58 | Install [[Freon>>url:https://extensions.gnome.org/extension/1180/freon/]] and [[Sensors>>url:https://extensions.gnome.org/extension/82/cpu-temperature-indicator/]] extension for Ubuntu Linux desktop: | ||
59 | [[image:https://www.cyberciti.biz/media/new/faq/2019/07/sensors-gui.png||alt="Shows CPU temperature, HDD temperature, voltage and fan RPM" height="749" width="285"]] | ||
60 | |||
61 | === How to install hddtemp in Ubuntu Linux === | ||
62 | |||
63 | Run the following [[apt command>>url:https://www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/?utm_source=Linux_Unix_Command&utm_medium=faq&utm_campaign=nixcmd]]: | ||
64 | sudo apt install hddtemp | ||
65 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/How-to-install-hddtemp-on-Ubuntu-Linux.png||alt="How to install hddtemp on Ubuntu Linux" height="413" width="599"]] | ||
66 | |||
67 | === How to see hard disk temperature in Ubuntu === | ||
68 | |||
69 | Simply type: | ||
70 | hddtemp | ||
71 | sudo hddtemp SATA:/dev/sda | ||
72 | Sample outputs: | ||
73 | |||
74 | {{{/dev/sda: Samsung SSD 850 EVO 500G: 32°C}}} | ||
75 | |||
76 | === Use disks & storage GUI tool to view hard disk temp === | ||
77 | |||
78 | Hard disks have a built-in health-check tool called SMART (Self-Monitoring, Analysis, and Reporting Technology), which continually checks the disk for potential problems. SMART also warns you if the disk is about to fail, helping you avoid loss of important data. It also displays hard disk temperature. Run: | ||
79 | gnome-disks | ||
80 | [[image:https://www.cyberciti.biz/media/new/faq/2019/08/Monitoring-hard-disk-Temperatures-on-Ubuntu-Linux-with-GUI-tool.png||alt="Monitoring hard disk Temperatures on Ubuntu Linux with GUI tool" height="416" width="599"]] | ||
81 | |||
82 | == How to monitor Nvme ssd temperature in Ubuntu == | ||
83 | |||
84 | First install nvme-cli, run: | ||
85 | sudo apt install nvme-cli | ||
86 | Now use the nvme command as follows to get list of all NVMe devices and namespaces on machine: | ||
87 | sudo nvme list | ||
88 | Sample outputs: | ||
89 | |||
90 | {{{Node SN Model Namespace Usage Format FW Rev | ||
91 | ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- | ||
92 | /dev/nvme0n1 S3EUNX0JXXXXXXH Samsung SSD 960 EVO 500GB 1 36.53 GB / 500.11 GB 512 B + 0 B 2B7QCXE7}}} | ||
93 | |||
94 | |||
95 | sudo nvme smart-log /dev/nvme0 | ||
96 | One can filter output using the [[grep command>>url:https://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/?utm_source=Linux_Unix_Command&utm_medium=faq&utm_campaign=nixcmd]]: | ||
97 | sudo nvme smart-log /dev/nvme0 | grep temperature | ||
98 | |||
99 | {{{temperature : 40 C}}} |