因為使用的是源碼編譯安裝,查看解壓後的install檔案,如是說:如果想構建wireshark,首先確保GTK+和Glib已安裝;使用命令pkg-config glib-2.0 --modversion可檢測Glib2.x是否已安裝,我的執行結果是2.24.1,看來已經安裝過了;使用命令pkg-config gtk+-2.0 --modversion檢測GTK+ 2.x是否已安裝,我的結果是2.20.1,看來這個也沒問題。
文檔如是說:如果你想抓包,要先安裝libpcap,可在網站http://www.tcpdump.org下載。
具體過程:
1. libpcap安裝:
#./configure //可添加--prefix=/usr/local/libpcap-1.4.0指定安裝目錄
如果報如下錯: configure : error : your operating system's lex is insufficient to compile libpcap. ..
可使用命令flex -V查看其版本,根據提示使用apt-get install flex安裝flex。
#make
也出現報錯:make : yacc : 命令未找到 make : *** [grammer.c] 錯誤 127
linux下是用flex和bison來分別代替lex和yacc的,安裝直接使用命令:#apt-get install bison
# make install // 一切正常
2. wireshark安裝:
#./configure --prefix=/usr/local/wireshark-1.10.0
又報錯:configure : error : Head file pcap.h not found
我已經安裝過libpcap了,看來我自己指定的目錄使他沒有找到標頭檔,於是我設定環境變數:C_INCLUDE_PATH=/usr/local/libpcap-1.4.0/include和LD_LIBRARY_PATH=/usr/local/libpcap-1.4.0/lib還有LIBRARY_PATH=/usr/local/libpcap-1.4.0/lib。
#make //大概十多分鐘吧
#make install //安裝成功
3. 使用wireshark
進入安裝目錄執行./wireshark。