欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

Linux安装高版本tshark

时间:2023-05-22
文章目录

1、背景2、下载源代码并解压3、安装cmake3等依赖库4、编译安装tshark

4.1 BUG解决大法 1、背景

  最近在复现一篇将BERT应用在加密流量检测上的paper,其中需要用到高版本的tshark。由于服务器对应的操作系统为Centos,而通过yum命令安装版本较低,如下图所示:

yum provides tshark(搜索库)


  可以看到tshark是wireshark中的一个组件,如果通过yum install wireshark-1.10.14-25.el7.x86_64则会得到版本为1.10.14的tshark。

  既然无法通过yum安装高版本tshark,那只能使用源代码安装大法。

2、下载源代码并解压

  需要注意的是wget中选项-c表示的是断点续传,所以强烈建议加上该选项。

wget -c http://ftp.uni-kl.de/pub/wireshark/src/all-versions/wireshark-3.2.3.tar.xz

tar -xvf wireshark-3.2.3.tar.xz

3、安装cmake3等依赖库

  由于源代码安装需要用到cmake3进行编译,通过yum命令进行安装

yum install cmake3 glib2-devel libpcap libpcap-devel libgcrypt-devel glib2-devel qt-devel qt5-qtbase-devel qt5-linguist qt5-qtmultimedia-devel qt5-qtsvg-devel libcap-devel libcap-ng-devel gnutls-devel krb5-devel libxml2-devel lua-devel lz4-devel snappy-devel spandsp-devel libssh2-devel bcg729-devel libmaxminddb-devel sbc-devel libsmi-devel libnl3-devel libnghttp2-devel libssh-devel libpcap-devel c-ares-devel redhat-rpm-config rpm-build gtk+-devel gtk3-devel desktop-file-utils portaudio-devel rubygem-asciidoctor docbook5-style-xsl docbook-style-xsl systemd-devel python34 cmake3 git gcc gcc-c++ flex bison doxygen gettext-devel libxslt cmake

4、编译安装tshark

cd wireshark-3.2.3cmake3 、-DCMAKE_EXE_linkER_FLAGS='-static-libstdc++' make -i -j 16 make install

4.1 BUG解决大法

  如果在make -i -j 16时出现以下错误:

/home/anaconda3/lib/libQt5Widgets.so.5.9.5: undefined reference to `operator delete[](void*, unsigned long)@CXXABI_1.3.9'/home/anaconda3/lib/libpng16.so.16: undefined reference to `inflatevalidate@ZLIB_1.2.9'/home/anaconda3/lib/libQt5Core.so.5.9.5: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'/home/anaconda3/lib/libQt5Multimedia.so.5.9.5: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'

  或者是:

/home/anaconda3/lib/libpng16.so.16: undefined reference to `inflatevalidate@ZLIB_1.2.9'

  最简单的解决方案是先将anaconda的文件夹进行重命名,然后安装后再重新改回来。曾经尝试各种其他方法也无法顺利安装,如果有更好的方法欢迎大佬在留言区分享。

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。