CentOS 7.6源码安装iftop

我的文章参考了《centos 源码安装:iftop》博客。
CentOS 7.6.1810源码安装iftop,依赖包基于Flex,Bison,libpcap。
cat /etc/redhat-release看一下操作系统的版本。
在这里插入图片描述

先使用flex -Vbison -V ,tcpdump --version看一下依赖包是否安装完成。
在这里插入图片描述
wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz进行下载源码。
在这里插入图片描述

tar -zxvf iftop-0.17.tar.gz进行解压。
在这里插入图片描述

cd iftop-0.17进入源码目录里边。
在这里插入图片描述
执行./configure
在这里插入图片描述

发现报错:

configure: error: can't find pcap.hYou're not going to get very far without libpcap.

在这里插入图片描述
使用wget https://repo.almalinux.org/almalinux/8/PowerTools/x86_64/os/Packages/libpcap-devel-1.9.1-5.el8.x86_64.rpm --no-check-certificate下载libpcap-devel-1.9.1-5.el8.x86_64.rpm。
在这里插入图片描述
发现报错如下:

WARNING: cannot verify repo.almalinux.org's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:Issued certificate has expired.
HTTP request sent, awaiting response... 403 Forbidden

使用yum install -y ca-certificates安装ca-certificates
在这里插入图片描述
执行wget https://repo.almalinux.org/almalinux/8/PowerTools/x86_64/os/Packages/libpcap-devel-1.9.1-5.el8.x86_64.rpm
在这里插入图片描述
发现报错如下:

HTTP request sent, awaiting response... 403 Forbidden

yum -y install libpcap libpcap-devel直接使用yum源安装libpcaplibpcap-devel
在这里插入图片描述
再次执行./configure发现如下,就是成功了。
在这里插入图片描述

执行make进行编译。
在这里插入图片描述

执行make install进行安装。
在这里插入图片描述sudo iftop运行一下看看效果:
在这里插入图片描述

按Ctrl+C,可以退出。

这篇内容受启发于《网络排查案例课》


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部