开源代码安装,需要非常复杂的解决依赖的过程,甚至中间很可能会由于某些特殊的依赖和冲突无法进行。 本次就是在Mac和ubuntu中同时进行安装,最后mac环境的放弃了。
1 相关软件版本
系统版本
uname -a
输出
Linux ubuntu 5.4.0-84-generic
同样满足ubuntu20
wireshark代码下载
github地址 https://github.com/pengtianabc/wireshark-gm/releases 其中mac的安装包与自己系统不兼容,从源码安装由于依赖过多未成功。 下载wireshark-3.4.5-gm
2 编译安装
2.1 依赖解决
一键解决依赖
apt install -y cmake build-essential flex libglib2* libc-ares-dev libgcrypt-dev bison libssh-dev build-essential libpcap-dev libsystemd-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev
编译安装
解压代码后目录为wireshark-gm
cd wireshark-gm
mkdir build
cd build
cmake ..
make
make install
启动
如果系统是采用非root用户登录,图形化界面的用户权限可能较低,可以用命令行root权限启动。
sudo wireshark
启动效果
3 附录:依赖解决细节
在cmake执行过程中逐个包进行安装解决,记录如下。
cmake
Error message:
Command 'cmake' not found, but can be installed with:
Fix by:
apt install cmake -y
CMAKE_CXX_COMPILER
Error message:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
Fix by:
apt inapt install -y build-essential
GLIB2
Error message:
-- Checking for one of the modules 'glib-2.0'
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find GLIB2 (missing: GLIB2_LIBRARY GLIB2_MAIN_INCLUDE_DIR
GLIB2_INTERNAL_INCLUDE_DIR) (Required is at least version "2.32.0")
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/modules/FindGLIB2.cmake:108 (find_package_handle_standard_args)
CMakeLists.txt:1072 (find_package)
Fix by:
apt install libglib2* -y
GCRYPT
Error message:
Could NOT find GCRYPT (missing: GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR)
apt install -y libgcrypt-dev
CARES_LIBRARY
```bash
Error message:
On Ubuntu 20.04 (WSL edition) I've got the following issue: missing: CARES_LIBRARY CARES_INCLUDE_DIR.
Fix by:
apt install -y libc-ares-dev
LEX
Error message:
Could NOT find LEX (missing: LEX_EXECUTABLE)
Fix by:
apt install -y flex
Git
Error message:
Could NOT find Git
Fix by:
apt install -y git
YACC
Error message:
Could NOT find YACC (missing: YACC_EXECUTABLE)
Fix by:
apt install bison -y
LIBSSH
Error message:
Could NOT find LIBSSH (missing: LIBSSH_LIBRARIES LIBSSH_INCLUDE_DIRS LIBSSH_VERSION) (Required is at least version "0.6")
Fix by:
apt install -y libssh-dev build-essential
PCAP
Error message:
Could NOT find PCAP (missing: PCAP_LIBRARY PCAP_INCLUDE_DIR)
Fix by:
apt install -y libpcap-dev
Systemd
Error message:
Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)
Fix by:
apt install libsystemd-dev -y
FindQt5Core
Error message:
```bash
CMake Error at CMakeLists.txt:1155 (find_package):
By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Core", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Core" with any
of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
"Qt5Core_DIR" to a directory containing one of the above files. If
"Qt5Core" provides a separate development package or SDK, be sure it has
been installed.
Fix by:
apt install qtbase5-dev -y
FindQt5LinguistTools
Error message:
CMake Error at CMakeLists.txt:1155 (find_package):
By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5LinguistTools", but CMake did not find one.
Fix by:
apt install qttools5-dev -y
FindQt5Multimedia
Error message:
By not providing "FindQt5Multimedia.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5Multimedia", but CMake did not find one.
Fix by:
apt install qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev -y
|