wireshark是网络嗅探数据包并可视化分析网络数据的利器,基本从事网络流量工作的人员都会接触和使用,本文主要介绍linux下源码安装wireshark(之所以源码安装是因为内网服务器与外界网络不通,需要下载源码进行安装)。
1. 安装tcpdump
1)下载tcpdump-4.99.0.tar.gz
2) 解压tcpdump? ?tar -zxvf?tcpdump-4.99.0.tar.gz
3)编译安装? ./configure? ? make&&make install
2. 安装libpcap
1)下载libpcap-1.7.4.tar.gz
2)解压libpcap? ?tar -zxvf?libpcap-1.7.4.tar.gz
3)编译安装 ./configure? ? ?make&&make install
3. 安装wireshark
1)下载wireshark-2.4.1.tar.xz(注意不要安装版本太高的~~)
2)解压 tar -xvf wireshark-2.4.1.tar.xz? 得到wireshark-2.4.1.tar 再次解压tar -xvf wireshark-2.4.1.tar
3)? 编译 ./configure --prefix=/usr --libdir=/usr/lib64 --with-gtk=no --with-qt=no --disable-wireshark --sysconfdir=/etc
此时报错
checking for GLIB... no
configure: error: GLib 2.22.0 or later not found.
4. 安装Glib
1)下载glib-2.54.0.tar.xz
2)? ?解压?tar -xvf glib-2.54.0.tar.xz 再次解压tar -xvf glib-2.54.0.tar
3)编译?./configure --prefix=/usr --libdir=/usr/lib64 --enable-libmount=no
此时又报错
configure: error: Package requirements (libffi >= 3.0.0) were not met:
No package 'libffi' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
5. 安装libffi
1)下载libffi-3.2.1.tar.gz
2)编译?./configure --prefix=/usr --libdir=/usr/lib64 --disable-static
3)安装make&&make install
6. 安装pcre-8.41.tar.gz
1)? 下载pcre-8.41.tar.gz
2)解压 tar zxvf pcre-8.41.tar.gz
3)? ?编译?./configure --prefix=/usr --libdir=/usr/lib64 --docdir=/usr/share/doc/pcre-8.41 --enable-unicode-properties --enable-pcre16 --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-pcretest-libreadline --disable-static --enable-utf8
此时又报错
** Cannot --enable-pcretest-readline because readline/readline.h was not found.
7. 安装readline-6.2.tar.gz
1) 下载readline-6.2.tar.gz
2)解压 tar zxvf?readline-6.2.tar.gz
3)? 编译??./configure --prefix=/usr/local/readline
4)安装 make && make install
8. 安装gettext-0.21.tar.gz
1)下载gettext-0.21.tar.gz
2) 编译? ./configure --prefix=/usr --libdir=/usr/lib64
3)? ?安装 make&&make install
9. 再次安装Glib
此时又报错
configure: error: *** The system-supplied PCRE does not support Unicode properties or UTF-8.
10. 重新安装pcre
1)重新编译? ./configure --enable-utf8 --enable-unicode-properties
2)? ?重新安装 make&&make install
11. 重新安装Glib
12. 重新安装wireshark
13. 测试wireshark
tshark -version