在 Debian 上装 cpustat 有几种常见方式,看你想用哪种:
sudo apt update
sudo apt install cpustat
装完直接用:
sudo cpustat
注:Debian 仓库里的
cpustat一般是 Colin Ian King 写的那个(包名就是cpustat)。
sudo apt install git build-essential
git clone https://github.com/colin-i-king/cpustat.git
cd cpustat
make
sudo make install
sudo cpustat 1 5 # 每1秒采样,共5次
sudo cpustat -x 1 # 显示扩展信息
cpustat 通常需要 root,否则可能报错或数据不全which cpustat如果你是 最小系统 / 容器,可能要先:
sudo apt install linux-tools-common
需要我帮你确认 Debian 版本或排查具体报错吗?