Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BUILD WIRESHARK ON UBUNTU OR DEBIAN
#!/bin/sh
# This shell script is made by SyneArt <sa@syneart.com>
#######################################
# BUILD WIRESHARK ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------------------------|
# | OS | Wireshark | Test | Last test |
# |----------------|----------------|------|-------------|
# | Ubuntu 20.04.1 | Commit:a3b2afa | OK | 05 Nov 2020 |
# | Ubuntu 18.04.1 | Commit:8beab04 | OK | 20 Nov 2018 |
# | Ubuntu 16.04.5 | Commit:8beab04 | OK | 20 Nov 2018 |
# | Ubuntu 14.04.5 | Commit:8beab04 | OK | 20 Nov 2018 |
# | Debian 9.6 | Commit:8beab04 | OK | 20 Nov 2018 |
# 1. KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y autoremove
# 2. INSTALL THE DEPENDENCIES
sudo apt-get install -y build-essential git cmake
# CMAKE3
sudo apt-get install -y cmake3
# GUI
sudo apt-get install -y qttools5-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-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
# 3. BUILD THE WIRESHARK
git clone https://github.com/wireshark/wireshark ~/wireshark
cd ~/wireshark
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\""
}
#!/bin/sh
# This shell script is made by SyneArt <sa@syneart.com>
#######################################
# BUILD WIRESHARK ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------------------------|
# | OS | Wireshark | Test | Last test |
# |----------------|----------------|------|-------------|
# | Ubuntu 20.04.1 | Commit:a679ae6 | OK | 05 Nov 2020 |
# | Ubuntu 18.04.1 | Commit:a679ae6 | OK | 20 Nov 2018 |
# | Ubuntu 16.04.5 | Commit:a679ae6 | OK | 20 Nov 2018 |
# | Ubuntu 14.04.5 | Commit:a679ae6 | OK | 20 Nov 2018 |
# | Debian 9.6 | Commit:a679ae6 | OK | 20 Nov 2018 |
# 1. KEEP UBUNTU OR DEBIAN UP TO DATE
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y autoremove
# 2. INSTALL THE DEPENDENCIES
sudo apt-get install -y build-essential git cmake
# CMAKE3
sudo apt-get install -y cmake3
# GUI
sudo apt-get install -y qttools5-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-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
# 3. BUILD THE WIRESHARK
git clone https://github.com/wireshark/wireshark ~/wireshark_f1ap_r15_2_1
cd ~/wireshark_f1ap_r15_2_1
git checkout a679ae6 # F1AP R15.2.1
mkdir build
cd build
cmake -DDISABLE_WERROR=true ../ # g++
make -j`nproc` && {
echo "\nBuild Success!"
echo "You can execute the Wireshark by command \"sudo ./wireshark\""
echo "at \"`pwd`/run\""
}
@syneart
Copy link
Author

syneart commented Nov 20, 2018

Use below command to build the latest Wireshark on your own operating system.
wget -O - https://gist.githubusercontent.com/syneart/2d30c075c140624b1e150c8ea318a978/raw/build_wireshark.sh | sh

@syneart
Copy link
Author

syneart commented May 22, 2019

Use below command to build the Wireshark with F1AP R15.2.1 on your own operating system.
wget -O - https://gist.githubusercontent.com/syneart/2d30c075c140624b1e150c8ea318a978/raw/build_wireshark_F1AP_R15_2_1.sh |sh

Copy link

ghost commented Jun 18, 2020

Thanks! I got it on my Chromebook lol

@syneart
Copy link
Author

syneart commented Jul 1, 2020

Thanks! I got it on my Chromebook lol

Glad to help.

@amaslenn
Copy link

amaslenn commented Oct 30, 2020

Great instruction, thank you!

On Ubuntu 20.04 (WSL edition) I've got the following issue: missing: CARES_LIBRARY CARES_INCLUDE_DIR.
Fixed by installing libc-ares-dev package.

@syneart
Copy link
Author

syneart commented Nov 7, 2020

Great instruction, thank you!

On Ubuntu 20.04 (WSL edition) I've got the following issue: missing: CARES_LIBRARY CARES_INCLUDE_DIR.
Fixed by installing libc-ares-dev package.

Thanks for the information.

@Avacee
Copy link

Avacee commented Nov 19, 2020

Hi syneart

Many thanks for this. You've restored my sanity after finding the wireshark docs lacking such simple instructions.

For those who want to use Lua scripts the lua-dev library must be installed - normal/non-dev lua won't work.
Note: Although Lua 5.3 is released it is not compatible with wireshark (as at 19/11/2020) but 5.2 is.
sudo apt-get -y install liblua5.2-dev

As all plugins (including Lua) are disabled when wireshark is invoked using sudo this can not be used.
However, a non-root user does not have the appropriate privileges to the dumpcap file so the following is needed:
sudo setcap cap_net_raw,cap_net_admin+eip ~/wireshark/build/run/dumpcap
Tested Ubuntu 20.04.1 LTS.

@errord
Copy link

errord commented Jun 9, 2021

good job!

@syneart
Copy link
Author

syneart commented Jun 19, 2021

Hi syneart

Many thanks for this. You've restored my sanity after finding the wireshark docs lacking such simple instructions.

For those who want to use Lua scripts the lua-dev library must be installed - normal/non-dev lua won't work.
Note: Although Lua 5.3 is released it is not compatible with wireshark (as at 19/11/2020) but 5.2 is.
sudo apt-get -y install liblua5.2-dev

As all plugins (including Lua) are disabled when wireshark is invoked using sudo this can not be used.
However, a non-root user does not have the appropriate privileges to the dumpcap file so the following is needed:
sudo setcap cap_net_raw,cap_net_admin+eip ~/wireshark/build/run/dumpcap
Tested Ubuntu 20.04.1 LTS.

You're right! I really appreciate you noticing that.

@syneart
Copy link
Author

syneart commented Jun 19, 2021

good job!

Thank you, that's very kind of you!

@berkakinci
Copy link

berkakinci commented Aug 27, 2021

Thank you! It's a shame I couldn't find a simple list of dependencies in the Wireshark build instructions... This list of apt installs got me building in no time.

@syneart
Copy link
Author

syneart commented Sep 7, 2021

Thank you! It's a shame I couldn't find a simple list of dependencies in the Wireshark build instructions... This list of apt installs got me building in no time.

It's my pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment