CentOS 7.6源码安装iftop

CentOS 7.6.1810源码安装iftop,依赖包基于Flex,Bison,libpcap。
cat /etc/redhat-release看一下操作系统的版本。
在这里插入图片描述

先使用flex -Vbison -V ,tcpdump --version看一下依赖包是否安装完成。
CentOS 7.6源码安装iftop_第1张图片
wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz进行下载源码。
CentOS 7.6源码安装iftop_第2张图片

tar -zxvf iftop-0.17.tar.gz进行解压。
CentOS 7.6源码安装iftop_第3张图片

cd iftop-0.17进入源码目录里边。
在这里插入图片描述
执行./configure
CentOS 7.6源码安装iftop_第4张图片

发现报错:

configure: error: can't find pcap.h
  You'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。
CentOS 7.6源码安装iftop_第5张图片
发现报错如下:

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
CentOS 7.6源码安装iftop_第6张图片
执行wget https://repo.almalinux.org/almalinux/8/PowerTools/x86_64/os/Packages/libpcap-devel-1.9.1-5.el8.x86_64.rpm
CentOS 7.6源码安装iftop_第7张图片
发现报错如下:

HTTP request sent, awaiting response... 403 Forbidden

yum -y install libpcap libpcap-devel直接使用yum源安装libpcaplibpcap-devel
CentOS 7.6源码安装iftop_第8张图片
再次执行./configure发现如下,就是成功了。
CentOS 7.6源码安装iftop_第9张图片

执行make进行编译。
CentOS 7.6源码安装iftop_第10张图片

执行make install进行安装。
CentOS 7.6源码安装iftop_第11张图片sudo iftop运行一下看看效果:
CentOS 7.6源码安装iftop_第12张图片
按Ctrl+C,可以退出。

我的文章参考了《centos 源码安装:iftop》博客。

你可能感兴趣的:(网络学习,centos,linux)