在 Debian(及 Debian 系如 Ubuntu)里,cpustat 通常来自 sysstat 包或 cpustat 专用包,取决于你指的是哪一种工具:
cpustat(来自 cpustat 工具)这是较不常见的工具,有些版本在仓库里叫 cpustat:
sudo apt update
sudo apt install cpustat
如果提示 E: Unable to locate package cpustat,说明你的 Debian 版本仓库里没有,可跳过看下面。
mpstat / sar(来自 sysstat)很多人把 sysstat 里的 CPU 统计工具误叫成 cpustat。
sudo apt update
sudo apt install sysstat
安装后可用:
mpstat 1
sar -u 1
cpustat(perf 相关)如果是内核源码里的工具:
sudo apt install linux-tools-common linux-tools-$(uname -r)
如果你是看 CPU 使用率、核级别统计,直接装:
sudo apt install sysstat
mpstat 1
如果你能贴一下你看到的 cpustat 命令出处(文章 / 报错),我可以精确告诉你装哪个。