温馨提示×

centos cpustat如何更新

小樊
43
2026-08-04 10:44:53
栏目: 智能运维

在 CentOS 系统中,cpustat 通常不是系统默认自带的命令,它一般来自 sysstat 工具包(或者来自 pcp / collectl 等性能工具集)。你说的“更新 cpustat”,通常有以下几种含义,我分别说明:


一、确认 cpustat 来自哪个包

先确认你当前用的 cpustat 是哪个:

which cpustat
rpm -qf $(which cpustat)

常见情况:

命令来源 包名
/usr/bin/cpustat pcppcp-system-tools
mpstat / sar sysstat

二、更新 sysstat(常见情况)

如果你的 cpustat 实际是 sysstat 提供的 CPU 统计工具(如 mpstat)

1️⃣ 更新 sysstat

yum update sysstat

或(CentOS 8 / Stream):

dnf update sysstat

2️⃣ 验证版本

mpstat -V

三、更新 pcp / cpustat(如果你用的是 PCP)

cpustatPCP(Performance Co-Pilot) 中是真实存在的命令。

1️⃣ 更新 PCP 相关包

yum update pcp pcp-system-tools

或:

dnf update pcp pcp-system-tools

2️⃣ 验证

cpustat -?
cpustat -u 1

四、如果系统里根本没有 cpustat

✅ 安装方式

CentOS 7

yum install pcp-system-tools

CentOS 8 / Stream

dnf install pcp-system-tools

五、只想“实时查看 CPU 状态”(替代方案)

如果你其实只是想 实时查看 CPU 使用情况,不一定非要用 cpustat

top
htop        # 需要 epel-release
mpstat 1
sar -u 1
vmstat 1
iostat -c 1

六、确认内核 / 系统是否需要重启更新

如果是内核相关的新 CPU 特性支持:

uname -r
yum update kernel
reboot

七、总结(快速判断)

which cpustat
rpm -qf $(which cpustat)

然后执行:

yum update <对应包名>

如果你愿意,可以把下面两条命令的输出贴出来,我可以精确告诉你该怎么更新

which cpustat
rpm -qf $(which cpustat)

0