Table of Contents
The following must be installed in order to build Wireshark:
Either make or Ninja can be used to build Wireshark; at least one of those must be installed.
To build the manual pages, Developer’s Guide and User’s Guide, Asciidoctor, Xsltproc, and DocBook must be installed.
Perl is required to generate some code and run some code analysis checks.
Some features of Wireshark require additional libraries to be installed.
There are shell scripts in the tools
directory to install the packages
and libraries required to build Wireshark. Usage is available with the
--help
option. root
permission is required to run the scripts.
The available scripts and their options:
Alpine Linux (tools/alpine-setup.sh)
--install-optional
install optional software as well
--install-all
install everything
[other]
other options are passed as-is to apk
Arch Linux and pacman-based systems (tools/arch-setup.sh)
--install-optional
install optional software as well
--install-test-deps
install packages required to run all tests
--install-all
install everything
[other]
other options are passed as-is to pacman
BSD systems such as FreeBSD, NetBSD, OpenBSD, and DragonFly BSD
(tools/bsd-setup.sh)
--install-optional
install optional software as well
[other]
other options are passed as-is to pkg manager
Debian, and Linux distributions based on Debian, such as Ubuntu
(tools/debian-setup.sh)
--install-optional
install optional software as well
--install-deb-deps
install packages required to build the .deb file
--install-test-deps
install packages required to run all tests
--install-qt5-deps
force installation of packages required to use Qt5
--install-qt6-deps
force installation of packages required to use Qt6
--install-all
install everything
[other]
other options are passed as-is to apt
RPM-based Linux distributions such as Red Hat, Centos, Fedora, and
openSUSE
(tools/rpm-setup.sh)
--install-optional
install optional software as well
--install-rpm-deps
install packages required to build the .rpm file
--install-qt5-deps
force installation of packages required to use Qt5
--install-qt6-deps
force installation of packages required to use Qt6
--install-all
install everything
[other]
other options are passed as-is to the packet manager
For macOS, you must first install Xcode. After installing Xcode, the
script tools/macos-setup.sh
will install the rest of the tools and
libraries required to build Wireshark, as well as the additional tools
required to build the documentation and the libraries required for all
Wireshark features. If you’re using Homebrew, the script
tools/macos-setup-brew.sh
will install the same tools and libraries
from Homebrew.
If an install package is not available or you have a reason not to use it (maybe because it’s simply too old), you can install that tool from source code. The following sections will provide you with the webpage addresses where you can get these sources.
The recommended (and fastest) way to build Wireshark is with CMake and Ninja. Building with make took nearly 2x time as Ninja in one experiment.
CMake builds are best done in a separate build directory, such as a
build
subdirectory of the top-level source directory.
If that directory is a subdirectory of the top-level source directory,
to generate the build files, change to the build directory and enter the
following command:
cmake ..
to use make as the build tool or
cmake -G Ninja ..
to use Ninja as the build tool.
If you created the build directory in the same directory that contains the top-level Wireshark source directory, to generate the build files, change to the build directory and enter the following command:
cmake ../{source directory}
to use make as the build tool or
cmake -G Ninja ../{source directory}
to use Ninja as the build tool.
{source directory}
is the name of the
top-level Wireshark source directory.
If you need to build with a non-standard configuration, you can run
cmake -LH ../{source directory}
to see what options you have.
You can then run Ninja or make to build Wireshark.
ninja # or make
Once you have build Wireshark with ninja
or make
above, you should be able to test it
by entering run/wireshark
.
Install Wireshark in its final destination:
make install
Once you have installed Wireshark with make install
above, you should be able
to run it by entering wireshark
.
To build the Wireshark User’s Guide and the Wireshark Developer’s Guide,
build the all_guides
target, e.g. make all_guides
or ninja
all_guides
. Detailed information to build these guides can be found in
the file docbook/README.adoc in the Wireshark sources.
You can create packages using the following build targets and commands:
dist
target.
dpkg-buildpackage
.
wireshark_rpm
target.
wireshark_appimage
target.
wireshark_dmg
or logray_dmg
targets.
Installable packages typically require building Wireshark first.
A number of errors can occur during the build and installation process. Some hints on solving these are provided here.
If the cmake
stage fails you will need to find out why. You can check the
file CMakeOutput.log
and CMakeError.log
in the build directory to find
out what failed. The last few lines of this file should help in determining the
problem.
The standard problems are that you do not have a required development package on your system or that the development package isn’t new enough. Note that installing a library package isn’t enough. You need to install its development package as well.
If you cannot determine what the problems are, send an email to the
wireshark-dev mailing list explaining your problem. Include the output from
cmake
and anything else you think is relevant such as a trace of the
make
stage.