base) root@kafka html# yum install -y tcpreplay Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com No package tcpreplay available. Error: Nothing to do
这个报错说明 tcpreplay 不在系统的默认软件源里。因为你的系统可能是CentOS 7或更早的版本,需要先启用 EPEL (Extra Packages for Enterprise Linux) 仓库才能直接安装。
按顺序执行下面两条命令,一行一行来:
bash
# 1. 安装 EPEL 仓库(包含了 tcpreplay 这类额外软件包)
sudo yum install -y epel-release
# 2. 安装 tcpreplay
sudo yum install -y tcpreplay
安装完成后,可以用这条命令验证是否成功:
bash
tcpreplay --version