Ubuntu系统中无法通过cpuinfo
命令直接查看CPU温度
cpuinfo
(对应命令cat /proc/cpuinfo
)是Ubuntu用于显示CPU硬件信息的工具,主要输出内容包括CPU型号、核心数、线程数、架构等静态信息,不包含实时温度数据。
lm-sensors
工具(命令行首选)lm-sensors
是Linux下最常用的硬件传感器监控工具,支持绝大多数主板和CPU的温度检测。
lm-sensors
,并通过sudo sensors-detect
自动检测硬件传感器(全程按Enter
选择默认选项):sudo apt update
sudo apt install lm-sensors
sudo sensors-detect
sensors
命令即可显示CPU温度(包括封装温度、核心温度及阈值):sensors
示例输出:coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +45.0°C (high = +80.0°C, crit = +100.0°C)
Core 0: +42.0°C (high = +80.0°C, crit = +100.0°C)
Core 1: +43.0°C (high = +80.0°C, crit = +100.0°C)
其中,“Package id 0”表示CPU整体封装温度,“Core 0/1”表示单个核心温度。Linux内核将热源划分为多个thermal_zone
目录,CPU温度通常存储在thermal_zone0
中,单位为毫摄氏度(需除以1000转换为摄氏度)。
cat /sys/class/thermal/thermal_zone0/temp
示例输出:45000
(即45.0°C)。sensors
的图形化前端,提供温度趋势图表、高温警报等功能。sudo apt install psensor
psensor # 启动图形界面
gnome-system-monitor
插件扩展温度显示)。sensors
命令无输出,需安装对应内核模块(如coretemp
):sudo apt install linux-modules-extra-$(uname -r)
,并加载模块:sudo modprobe coretemp
。