Linux编译安装wireshark

由于centos默认yum安装的wireshark版本较低,这里采用编译安装的形式安装wireshark,安装过程中坑不少,略麻烦,记录下过程

libpcap安装

安装wireshark之前,要先安装wireshark的好基友libpcap

wget http://www.tcpdump.org/release/libpcap-1.9.0.tar.gz
tar -zxvf libpcap-1.9.0.tar.gz
cd libpcap-1.7.4
./configure
make
make install

如执行./configure的时候出现错误:
configure: error: Neither flex nor lex was found.
解决方法,先安装依赖: yum install flex bison

wireshark安装

wget https://www.wireshark.org/download/src/all-versions/wireshark-2.6.5.tar.xz
tar xJf wireshark-2.6.5.tar.xz
cd wireshark-2.6.5
./configure
make
make install

如执行./configure的时候出现错误:
configure: error: libgcrypt not installed for development; install libgcrypt, including any development package, for your system
解决方法,先安装依赖:

 wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.33.tar.gz
 ./configure
 make
 make install
 wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.gz
 ./configure
 make
 make install
 wget http://ftp.acc.umu.se/pub/GNOME/sources/glib/2.59/glib-2.59.0.tar.xz
./configure
make
make install

#安装glib之前安装以下下依赖

yum install libffi-deve
yum install libmount-devel
wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.42/pcre-8.42.tar.gz
./configure  --enable-utf8 --enable-unicode-properties
make
make install

#如提示checking for windows.h… no configure: error: Invalid C++ compiler or C++ compiler flags
#安装c++编译器

yum install gcc-c++

#如安装glib ./configure时报错No package ‘libpcre’ found

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

#如遇到错误: gregex.c:1573:18: error: ‘PCRE_INFO_MAXLOOKBEHIND’ undeclared 是因为pcre版本过低的缘故,使用高版本即可

最后,安装wireshark还需要安装Qt的依赖
yum install qt-devel

如果wireshark想要使用lua脚本,需先安装lua包:

yum install lua-devel

安装完lua包之后,在wireshark的configure之后可以看到如下字样:
Use Lua library : yes

好了,所有依赖解决,开始make编译安装wireshark,make的时间巨长,耐心等待吧

Linux编译安装wireshark_第1张图片

你可能感兴趣的:(Linux编译安装wireshark)