#!/bin/sh # This shell script is made by SyneArt ####################################### # BUILD WIRESHARK ON UBUNTU OR DEBIAN # ####################################### # | THIS SCRIPT IS TESTED CORRECTLY ON | # |----------------------------------------------------------| # | OS | Wireshark | Test | Last test | # |--------------------|----------------|------|-------------| # | Ubuntu 24.04 (Dev) | Commit:73c7fca | OK | 29 Jan 2024 | # | Ubuntu 22.04.2 LTS | Commit:73c7fca | OK | 29 Jan 2024 | # | Ubuntu 20.04.6 LTS | Commit:73c7fca | OK | 29 Jan 2024 | # | Ubuntu 18.04.6 LTS | Commit:73c7fca | OK | 28 Jan 2024 | # | Debian 12.4 | Commit:73c7fca | OK | 29 Jan 2024 | # | Debian 11.8 | Commit:73c7fca | OK | 29 Jan 2024 | # 1. KEEP UBUNTU OR DEBIAN 's apt-cache UP TO DATE sudo apt-get update export DEBIAN_FRONTEND=noninteractive ln -fs /usr/share/zoneinfo/$(wget -qO - http://ip-api.com/line?fields=timezone) /etc/localtime sudo apt-get install -y tzdata # 2. INSTALL THE DEPENDENCIES sudo apt-get install -y build-essential git cmake # CMake3 sudo apt-get install -y cmake3 # CMake 3.13 or higher is required for Wireshark now dpkg --compare-versions `cmake --version | head -1 | cut -f3 -d" "` lt 3.13 && { sudo apt install -y software-properties-common wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - sudo apt-add-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' sudo apt install -y cmake } # GUI sudo apt-get install -y qttools5-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev sudo apt-get install -y qt6-base-dev qt6-multimedia-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev # check qt6 backports, if need apt-cache search qt6-multimedia-dev | grep qt6 >/dev/null || { [ -e /etc/debian_version ] && { # Debian bullseye-backports # https://packages.debian.org/bullseye-backports/ echo "deb http://deb.debian.org/debian bullseye-backports main contrib non-free" | sudo tee -a /etc/apt/sources.list sudo apt-get update sudo apt install -y qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools qt6-5compat-dev -t bullseye-backports } || { # Ubuntu qt6-backports # https://launchpad.net/~okirby/+archive/ubuntu/qt6-testing sudo apt install -y software-properties-common sudo add-apt-repository ppa:okirby/qt6-backports -y sudo apt install -y libgl1-mesa-dev sudo apt install -y qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev } } # PCAP sudo apt-get install -y libpcap-dev # Dev file (On Ubuntu 20.04) sudo apt-get install -y libc-ares-dev # CRYPT sudo apt-get install -y libgcrypt20-dev # GLIB2 sudo apt-get install -y libglib2.0-dev # LEX & YACC sudo apt-get install -y flex bison # PCRE2 (On Ubuntu 18.04) sudo apt-get install -y libpcre2-dev # HTTP/2 protocol (Ubuntu >= 16.04) sudo apt-get install -y libnghttp2-dev # HTTP/3 protocol (Ubuntu >= 22.04) sudo apt-get install -y libnghttp3-dev # SpeexDSP sudo apt-get install -y libspeexdsp-dev # 3. BUILD THE WIRESHARK git clone https://github.com/wireshark/wireshark ~/wireshark cd ~/wireshark sed -i '15 a #include ' capture/capture_ifinfo.h mkdir build cd build cmake ../ make -j`nproc` && { echo "\nBuild Success!" echo "You can execute the Wireshark by command \"sudo ./wireshark\"" echo "at \"`pwd`/run\"" }