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. The processes for doing so on various UN*X families is shown here.
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 for a given family of UN*Xes are
shown in the section for that family.
The setup script is tools/alpine-setup.sh
; its options are:
--install-optional
install optional software as well
--install-all
install everything
[other]
other options are passed as-is to apk
The setup script is tools/arch-setup.sh
; its options are:
--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
The setup script is tools/bsd-setup.sh
; its options are:
--install-optional
install optional software as well
[other]
other options are passed as-is to pkg manager
The setup script is tools/debian-setup.sh
; its options are:
--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 (not recommended)
--install-qt6-deps
force installation of packages required to use Qt6
--install-all
install everything
[other]
other options are passed as-is to apt
The setup script is tools/rpm-setup.sh
; its options are:
--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 (not recommended)
--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
You must first install Xcode.
As with Windows we provide pre-built third party libraries which will be automatically installed if you set the WIRESHARK_BASE_DIR
CMake variable to a directory that is writable by you, such as /opt/wireshark-third-party or wireshark-libraries at the same level as your Wireshark source code directory.
You can use tools/macos-setup-brew.sh
to install the tools required to build Wireshark using the Homebrew package manager.
You can also use it to install third party libraries instead of setting WIRESHARK_BASE_DIR
.
--install-required
install third party libraries required to build Wireshark. Not needed if you set WIRESHARK_BASE_DIR
.
--install-optional
install optional third party libraries. Not needed if you set WIRESHARK_BASE_DIR
.
--install-dmg-deps
install packages required to build the .dmg file
--install-sparkle-deps
install the Sparkle automatic updater
--install-all
install everything
--install-stratoshark
install libraries required to build Stratoshark and the Falco Events plugin
[other]
other options are passed as-is to brew
Running tools/macos-setup-brew.sh
with no options will install CMake, Ninja, pgkconf, and ccache.
In the past, tools/macos-setup.sh
could be used to build third party libraries locally.
It is now deprecated, and can only be used to install the tools required to build Wireshark or to remove any previously installed libraries.
It supports the following options:
-n
dry run; don’t build or install any tools
-p
specify the installation prefix; /usr/local is the default
-u
uninstall packages
We recommend setting WIRESHARK_BASE_DIR
to install libraries, since it’s easy and it’s what we use to create the offical packages.
If you’re using Homebrew we recommend using tools/macos-setup-brew.sh
with no options to install CMake and Ninja.
You will also have to install Qt 6. To install Qt, go to the Download Qt for open source use page, select “macOS” if it’s not already selected, and then select “Qt online installer for macOS“. This will download a .dmg for the installer; launch the installer. It will require that you log into your Qt account; if you don’t have an account, select “Sign up“ to create one. The next page will require you to accept the LGPL (Lesser GNU Public License); do so. Continue to the “Installation Folder“ page of the installer screen, and select the “Custom installation“ option. On the “Select Components“ screen of the installer, select your desired Qt version. We recommend using the same Qt version used to build the official Wireshark packages, which at the time of this writing is Qt 6.9.3. Select the following components:
Optionally, under "Additional Libraries" also select the following components:
You can deselect all of the other the components such as “Qt Charts” or “Android xxxx” as they aren’t required.
If you don’t want register for the Qt Online Installer for macOS, you can install Qt from the command line using Another (unofficial) Qt CLI Installer. The AQt command to install Qt and the modules recommended above would look something like the following:
aqt install-qt mac desktop 6.9.3 clang_64 --modules qt5compat qtmultimedia debug_info
Before building:
On macOS, you will need to set the Qt installation directory in the environment:
WIRESHARK_QT6_PREFIX_PATH=~/Qt/6.9.3/macos export WIRESHARK_QT6_PREFIX_PATH
If you want to append a custom string to the package version, run the command
WIRESHARK_VERSION_EXTRA=-YourExtraVersionInfo export WIRESHARK_VERSION_EXTRA
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 doc/README.documentation.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 stratoshark_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.