1 See also https://gitlab.com/wireshark/wireshark/-/wikis/Development
2 and the Developer's Guide located at https://www.wireshark.org/docs/
3 and in the doc/ subdirectory.
8 These are installation instructions for Unix and Unix-like systems.
9 These are not the installation instructions for Windows systems; see
10 the Wireshark User's Guide and Wireshark Developer's Guide at
11 https://www.wireshark.org/docs/ for those.
13 0. This is software. Beware.
15 1. If you wish to build Wireshark, make sure you have the Qt and GLib
16 development packages installed. Try running
17 'pkg-config glib-2.0 --modversion' to see if you have GLib 2.x
18 installed. Then try running 'pkg-config Qt5Widgets --modversion'
19 to see if you have Qt installed. Wireshark requires Qt 5.9 or later,
20 but the most recent LTS release is strongly recommended. It needs
21 version 2.50.0 or above of GLib. If you need to install or
22 re-install GLIB, you can find the packages at:
24 https://download.gnome.org/sources/glib/
28 https://www.qt.io/download
30 If you installed Qt or GLib from binary packages, you may have to
31 install corresponding "development" packages; there may be separate
32 "user's" and "developer's" packages, with the former not including
33 header files and the like. For example, Red Hat users will need to
34 install a "glib2-devel" .rpm.
36 2. If you wish to build TShark, the line-mode version of Wireshark,
37 make sure you have GLib installed. See note #1 above for instructions
38 on checking if you have GLib installed.
40 3. If you want to capture packets, make sure you have libpcap
41 installed. The latest "official" version can be found at
43 https://www.tcpdump.org .
45 If you installed libpcap from a binary package, you may have to
46 install a "development" package; for example, there's
47 apparently a "libpcap0" Debian package, but it just includes a
48 shared library, a copyright notice, changelog files, and a
49 README.md file - you also need to install a "libpcap-dev" package
50 to get header files, a non-shared library, and the man page.
51 Similarly, Red Hat users will need to install a "libpcap-devel"
52 .rpm to go along with the "libpcap" .rpm.
54 4. Building Wireshark requires Python, flex, and Asciidoctor.
56 5. Create a build directory separate from the source directory. It can
57 be anywhere, but you might run into issues if the path contains
60 6. Run 'cmake <options> <path/to/the/wireshark/sources>' in your build
61 directory. Running 'cmake -LH <path/to/the/wireshark/sources>'
62 displays a complete list of options. The "Tool Reference" section of
63 Developer's Guide contains general instructions for using CMake. Some
64 of the Wireshark-specific options are as follows:
67 CMake supports many different build systems, including UNIX
68 Make, MSBuild, and Ninja. UNIX Make is the default, but Ninja
72 By default CMake tries to find the Qt libraries so Wireshark,
73 the GUI packet analyzer, can be built. You can disable the
74 build of the GUI version of Wireshark with this switch.
77 By default the line-mode packet analyzer, TShark, is built.
78 Use this switch to avoid building it.
81 By default the capture-file editing program is built.
82 Use this switch to avoid building it.
85 By default the capture-file statistics reporting program
86 is built. Use this switch to avoid building it.
89 By default the capture-type reporting program is built. Use this
90 switch to avoid building it.
93 By default the capture-file merging program is built.
94 Use this switch to avoid building it.
96 -DBUILD_reordercap=OFF
97 By default the capture-file reordering program is built.
98 Use this switch to avoid building it.
100 -DBUILD_text2pcap=OFF
101 By default the hex-dump-to-capture file conversion program
102 is built. Use this switch to avoid building it.
105 By default the display-filter-compiler test program is built.
106 Use this switch to avoid building it.
109 By default the program which creates random packet-capture files
110 is built. Use this switch to avoid building it.
113 By default the network traffic capture program is built.
114 Use this switch to avoid building it.
117 By default the program used to dump and analyze raw libpcap data
118 is built. Use this switch to avoid building it.
120 -DDUMPCAP_INSTALL_OPTION=suid
121 -DDUMPCAP_INSTALL_OPTION=capabilities
122 Wireshark and TShark rely on dumpcap for packet capture. Setting
123 this flag to "suid" installs dumpcap with setuid root
124 permissions, which lets any user on the system capture live
125 traffic. If this is not desired, you can restrict dumpcap's
126 permissions so that only a single user or group can run it and
127 set the "capabilities" flag.
129 Running Wireshark or TShark as root is not recommended.
132 By default, if 'cmake' finds libcap (the POSIX capabilities
133 library) dumpcap will be built so that if it is installed setuid
134 root, it will attempt to retain CAP_NET_RAW and CAP_NET_ADMIN
135 before dropping root privileges. Use this option to disable this
139 If you choose to build a packet analyzer that can analyze
140 capture files but cannot capture packets on its own, but you
141 *do* have libpcap installed, or if you are trying to build
142 Wireshark on a system that doesn't have libpcap installed (in
143 which case you have no choice but to build a version that can
144 analyze capture files but cannot capture packets on its own),
145 use -DENABLE_PCAP=OFF to avoid using libpcap.
148 By default, if 'cmake' finds zlib (a.k.a, libz), the
149 wiretap library will be built so that it can read compressed
150 capture files. If you have zlib but do not wish to build
151 it into the wiretap library, used by Wireshark, TShark, and
152 the capture-file utilities that come in this package, use
156 By default, if 'cmake' finds brotli, the wiretap library
157 will be built so that it can read brotli compressed capture
158 files. If you have brotli but do not wish to build it into
159 the wiretap library, used by Wireshark, TShark, and the
160 capture-file utilities that come in this package, use this switch.
163 By default, if your system can support run-time loadable modules,
164 the packet analyzers are build with support for plugins.
165 Use this switch to build packet analyzers without plugin support.
167 7. After running 'cmake', you will see a summary of some
168 of the options you chose. Ensure that the summary reflects
169 what you want. If it doesn't, re-run 'cmake' with new options.
171 8. Run 'make', or 'ninja' if you chose to create Ninja build files.
172 Hopefully, you won't run into any problems.
174 9. Run './run/wireshark' or './run/tshark' or ./run/dumpcap, and make sure things are
175 working. You must have root privileges in order to capture live data.
177 10./a. Run 'make install'. If you're running a system that supports
178 the RPM packaging systems you can run
186 to make an installable package for your system. The installation path
187 defaults to /usr/local, so you'll probably want to pass
188 -DCMAKE_INSTALL_PREFIX=/usr to CMake.
190 10/b. If you 're running a system that supports APT (Debian/Ubuntu/etc.)
193 ln -sn packaging/debian
194 dpkg-buildpackage -us -uc -rfakeroot
196 in the source directory right after extracting of checking out
197 Wireshark's source code. (You don't have to run CMake/make/Ninja/etc.
198 prior to running dpkg-buildpackage)
201 If you have trouble with the build or installation process, you can
202 find assistance on the wireshark-users and wireshark-dev mailing lists (see
203 https://www.wireshark.org/lists/ for details) or the Wireshark Q&A site:
204 https://ask.wireshark.org .