1 See also https://wiki.wireshark.org/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 Qt6Widgets --modversion'
19 to see if you have Qt 6 installed. If not, then try running
20 'pkg-config Qt5Widgets --modversion' to see if you have Qt 5.
21 Wireshark requires Qt 5.15 or later, but the most recent LTS release
22 is strongly recommended. Building against Qt 5 will require the
23 CMake option '-DUSE_qt6=OFF'. Wireshark requires version 2.54.0 or
24 above of GLib. If you need to install or re-install GLib, you can
27 https://download.gnome.org/sources/glib/
31 https://www.qt.io/download
33 If you installed Qt or GLib from binary packages, you may have to
34 install corresponding "development" packages; there may be separate
35 "user's" and "developer's" packages, with the former not including
36 header files and the like. For example, Red Hat users will need to
37 install a "glib2-devel" .rpm.
39 2. If you wish to build TShark, the line-mode version of Wireshark,
40 make sure you have GLib installed. See note #1 above for instructions
41 on checking if you have GLib installed.
43 3. If you want to capture packets, make sure you have libpcap
44 installed. The latest "official" version can be found at
46 https://www.tcpdump.org .
48 If you installed libpcap from a binary package, you may have to
49 install a "development" package; for example, there's
50 apparently a "libpcap0" Debian package, but it just includes a
51 shared library, a copyright notice, changelog files, and a
52 README.md file - you also need to install a "libpcap-dev" package
53 to get header files, a non-shared library, and the man page.
54 Similarly, Red Hat users will need to install a "libpcap-devel"
55 .rpm to go along with the "libpcap" .rpm.
57 4. Building Wireshark requires Python, flex, and Asciidoctor.
59 5. Create a build directory separate from the source directory. It can
60 be anywhere, but you might run into issues if the path contains
63 6. Run 'cmake <options> <path/to/the/wireshark/sources>' in your build
64 directory. Running 'cmake -LH <path/to/the/wireshark/sources>'
65 displays a complete list of options. The "Tool Reference" section of
66 Developer's Guide contains general instructions for using CMake. Some
67 of the Wireshark-specific options are as follows:
70 CMake supports many different build systems, including UNIX
71 Make, MSBuild, and Ninja. UNIX Make is the default, but Ninja
75 By default CMake tries to find the Qt libraries so Wireshark,
76 the GUI packet analyzer, can be built. You can disable the
77 build of the GUI version of Wireshark with this switch.
80 By default the line-mode packet analyzer, TShark, is built.
81 Use this switch to avoid building it.
84 By default the capture-file editing program is built.
85 Use this switch to avoid building it.
88 By default the capture-file statistics reporting program
89 is built. Use this switch to avoid building it.
92 By default the capture-type reporting program is built. Use this
93 switch to avoid building it.
96 By default the capture-file merging program is built.
97 Use this switch to avoid building it.
99 -DBUILD_reordercap=OFF
100 By default the capture-file reordering program is built.
101 Use this switch to avoid building it.
103 -DBUILD_text2pcap=OFF
104 By default the hex-dump-to-capture file conversion program
105 is built. Use this switch to avoid building it.
108 By default the display-filter-compiler test program is built.
109 Use this switch to avoid building it.
112 By default the program which creates random packet-capture files
113 is built. Use this switch to avoid building it.
116 By default the network traffic capture program is built.
117 Use this switch to avoid building it.
120 By default the program used to dump and analyze raw libpcap data
121 is built. Use this switch to avoid building it.
124 By default if Qt is needed CMake tries to find the Qt 6 libraries.
125 Use this switch to search for and build with Qt 5 instead.
127 -DDUMPCAP_INSTALL_OPTION=suid
128 -DDUMPCAP_INSTALL_OPTION=capabilities
129 Wireshark and TShark rely on dumpcap for packet capture. Setting
130 this flag to "suid" installs dumpcap with setuid root
131 permissions, which lets any user on the system capture live
132 traffic. If this is not desired, you can restrict dumpcap's
133 permissions so that only a single user or group can run it and
134 set the "capabilities" flag.
136 Running Wireshark or TShark as root is not recommended.
139 By default, if 'cmake' finds libcap (the POSIX capabilities
140 library) dumpcap will be built so that if it is installed setuid
141 root, it will attempt to retain CAP_NET_RAW and CAP_NET_ADMIN
142 before dropping root privileges. Use this option to disable this
146 If you choose to build a packet analyzer that can analyze
147 capture files but cannot capture packets on its own, but you
148 *do* have libpcap installed, or if you are trying to build
149 Wireshark on a system that doesn't have libpcap installed (in
150 which case you have no choice but to build a version that can
151 analyze capture files but cannot capture packets on its own),
152 use -DENABLE_PCAP=OFF to avoid using libpcap.
155 By default, if 'cmake' finds zlib (a.k.a, libz), the
156 wiretap library will be built so that it can read compressed
157 capture files. If you have zlib but do not wish to build
158 it into the wiretap library, used by Wireshark, TShark, and
159 the capture-file utilities that come in this package, use
163 By default, if 'cmake' finds brotli, the wiretap library
164 will be built so that it can read brotli compressed capture
165 files. If you have brotli but do not wish to build it into
166 the wiretap library, used by Wireshark, TShark, and the
167 capture-file utilities that come in this package, use this switch.
170 By default, if your system can support run-time loadable modules,
171 the packet analyzers are build with support for plugins.
172 Use this switch to build packet analyzers without plugin support.
174 7. After running 'cmake', you will see a summary of some
175 of the options you chose. Ensure that the summary reflects
176 what you want. If it doesn't, re-run 'cmake' with new options.
178 8. Run 'make', or 'ninja' if you chose to create Ninja build files.
179 Hopefully, you won't run into any problems.
181 9. Run './run/wireshark' or './run/tshark' or ./run/dumpcap, and make sure things are
182 working. You must have root privileges in order to capture live data.
184 10./a. Run 'make install'. If you're running a system that supports
185 the RPM packaging systems you can run
193 to make an installable package for your system. The installation path
194 defaults to /usr/local, so you'll probably want to pass
195 -DCMAKE_INSTALL_PREFIX=/usr to CMake.
197 10/b. If you 're running a system that supports APT (Debian/Ubuntu/etc.)
200 ln -sn packaging/debian
201 dpkg-buildpackage -us -uc -rfakeroot
203 in the source directory right after extracting of checking out
204 Wireshark's source code. (You don't have to run CMake/make/Ninja/etc.
205 prior to running dpkg-buildpackage)
208 If you have trouble with the build or installation process, you can
209 find assistance on the wireshark-users and wireshark-dev mailing lists (see
210 https://www.wireshark.org/lists/ for details) or the Wireshark Q&A site:
211 https://ask.wireshark.org .