温馨提示×

debian装cpustat咋弄

小樊
41
2026-10-22 03:48:28
栏目: 智能运维

在 Debian 上装 cpustat 有几种常见方式,看你想用哪种:

方式一:直接用 apt 安装(最简单)

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,否则可能报错或数据不全
  • 命令找不到:确认是否在 PATH,或试 which cpustat

如果你是 最小系统 / 容器,可能要先:

sudo apt install linux-tools-common

需要我帮你确认 Debian 版本或排查具体报错吗?

0 踩