[20260725]centos 9安装dstat rpm包.txt
--//今天检查发现安装的centos 9没有安装dstat,查询iso文件,发现竟然没有dstat rpm包,有点意外.
--//而且记忆里安装后我使用过,什么会现在不能使用了,也许删除软件包时附带删除了.
--//查询发现: 原始dstat在CentOS 9/RHEL 9 中已被官方移除,因为它基于 Python 2 且已停止维护。
--//Red Hat 将 dstat 合并到了 Performance Co-Pilot (PCP) 项目中,pcp-dstat 完全兼容原 dstat 的命令和输出格式。
--//sudo dnf install -y pcp-system-tools
--//安装后,dstat 命令会自动可用(/usr/bin/dstat 是指向 pcp-dstat 的软链接)。
--//查看以前操作记录,发现执行过:
# dnf remove pcp\*
--//删除了大量的pcp开头相关的rpm包.安装这个监测使用中消耗大量的磁盘空间.
--//先模拟安装看看.
# mount /dev/sr0 /mnt/cdrom/ -o ro
# dnf install --setopt=tsflags=test -y pcp-system-tools
29cbaseos 2.2 MB/s | 2.3 kB 00:00
29cappstream 2.7 MB/s | 2.8 kB 00:00
Dependencies resolved.
===================================================================================
Package Architecture Version Repository Size
===================================================================================
Installing:
pcp-system-tools x86_64 6.3.7-9.el9 henry_appstream 366 k
Installing dependencies:
pcp x86_64 6.3.7-9.el9 henry_appstream 1.7 M
pcp-conf x86_64 6.3.7-9.el9 henry_appstream 31 k
pcp-libs x86_64 6.3.7-9.el9 henry_appstream 645 k
pcp-selinux x86_64 6.3.7-9.el9 henry_appstream 32 k
python3-pcp x86_64 6.3.7-9.el9 henry_appstream 156 k
Transaction Summary
===================================================================================
Install 6 Packages
Total size: 2.9 M
Installed size: 8.7 M
DNF will only download packages, install gpg keys, and check the transaction.
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Complete!
--//这会让 dnf 完整解析依赖、计算事务、显示要安装的所有包列表,但不会真正写入系统。
# dnf install -y pcp-system-tools
Last metadata expiration check: 0:01:14 ago on Sun 26 Jul 2026 12:24:49 PM CST.
Dependencies resolved.
===============================================================================
Package Architecture Version Repository Size
===============================================================================
Installing:
pcp-system-tools x86_64 6.3.7-9.el9 henry_appstream 366 k
Installing dependencies:
pcp x86_64 6.3.7-9.el9 henry_appstream 1.7 M
pcp-conf x86_64 6.3.7-9.el9 henry_appstream 31 k
pcp-libs x86_64 6.3.7-9.el9 henry_appstream 645 k
pcp-selinux x86_64 6.3.7-9.el9 henry_appstream 32 k
python3-pcp x86_64 6.3.7-9.el9 henry_appstream 156 k
Transaction Summary
===============================================================================
Install 6 Packages
Total size: 2.9 M
Installed size: 8.7 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: pcp-selinux-6.3.7-9.el9.x86_64 1/6
Installing : pcp-selinux-6.3.7-9.el9.x86_64 1/6
Running scriptlet: pcp-selinux-6.3.7-9.el9.x86_64 1/6
libsemanage.semanage_direct_install_info: Overriding pcp module at lower priority 100 with module at priority 200.
Installing : pcp-conf-6.3.7-9.el9.x86_64 2/6
Installing : pcp-libs-6.3.7-9.el9.x86_64 3/6
Running scriptlet: pcp-6.3.7-9.el9.x86_64 4/6
Installing : pcp-6.3.7-9.el9.x86_64 4/6
Running scriptlet: pcp-6.3.7-9.el9.x86_64 4/6
Installing : python3-pcp-6.3.7-9.el9.x86_64 5/6
Installing : pcp-system-tools-6.3.7-9.el9.x86_64 6/6
Running scriptlet: pcp-system-tools-6.3.7-9.el9.x86_64 6/6
Verifying : pcp-6.3.7-9.el9.x86_64 1/6
Verifying : pcp-conf-6.3.7-9.el9.x86_64 2/6
Verifying : pcp-libs-6.3.7-9.el9.x86_64 3/6
Verifying : pcp-selinux-6.3.7-9.el9.x86_64 4/6
Verifying : pcp-system-tools-6.3.7-9.el9.x86_64 5/6
Verifying : python3-pcp-6.3.7-9.el9.x86_64 6/6
Installed:
pcp-6.3.7-9.el9.x86_64 pcp-conf-6.3.7-9.el9.x86_64 pcp-libs-6.3.7-9.el9.x86_64 pcp-selinux-6.3.7-9.el9.x86_64
pcp-system-tools-6.3.7-9.el9.x86_64 python3-pcp-6.3.7-9.el9.x86_64
Complete!
# which dstat
/usr/bin/dstat
# ls -l /usr/bin/dstat
lrwxrwxrwx. 1 root root 35 2026-04-02 23:41:36 /usr/bin/dstat -> ../../usr/libexec/pcp/bin/pcp-dstat
--//已经建立软链接指向../../usr/libexec/pcp/bin/pcp-dstat
# dstat
You did not select any stats, using -cdngy by default.
----total-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai stl| read writ| recv send| in out | int csw
0 0 100 0 0| 0 0 | 60B 644B| 0 0 | 137 122
1 0 99 0 0| 0 0 | 120B 371B| 0 0 | 129 120
0 0 100 0 0| 0 0 | 60B 325B| 0 0 | 122 121
1 0 100 0 0| 0 55k| 178B 445B| 0 0 | 109 123
0 0 100 0 0| 0 0 | 60B 326B| 0 0 | 112 114 ^C
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-3177984/ ,如需转载,请注明出处,否则将追究法律责任。