Monday 16 August 2010

Compile wireshark in Ubuntu 10.04

Download source from http://www.wireshark.org/download.html

Now the version is 1.8.0, procedure still works, but there are some additional bits added, as example using c-ares, GNU ADNS and SMI MIB libraries.

$ tar -jxf wireshark-1.2.10.tar.bz2

# read INSTALL and check dependencies
$ pkg-config glib-2.0 --modversion
$ glib-config --version
$ gtk-config --version

# install dependencies
$ sudo aptitude install --add-user-tag wir libgtk2.0-dev
$ pkg-config glib-2.0 --modversion # confirm that it's working now
$ glib-config --version
$ pkg-config gtk+-2.0 --modversion

Good, let's install the rest of dependencies.
$ sudo aptitude install --add-user-tag wir libgtk2.0-dev libpcap0.8-dev bison flex libssl-dev libgnutls-dev libpcre3-dev libadns1-dev libc-ares-dev libsmi2-dev # I have libpcap0.8 installed already, you may need to install it as well.

./configure --with-ssl --with-gnutls --with-c-ares --with-libsmi
# two possible ways from here - traditional make, or Debian/Ubuntu making .deb pakages
Use method #1 for 10.04, this way the compilation completes nowadays in this old Ubuntu version, making debian packages fail because of libraries dependencies.
## 1
$ make; make install # if make is followed by make debian-package the whole compilation runs from the beginning. Skip this step and go to #2 instead

## 2
# add dependencies
$ sudo aptitude install --add-user-tag wir dpatch libtool automake1.9 autoconf autotools-dev libc-ares-dev docbook-xsl libpcre3-dev libcap-dev libgnutls-dev portaudio19-dev libkrb5-dev liblua5.1-0-dev libsmi2-dev libgeoip-dev # adding dependent packages for .deb building

# ...and make
$ make debian-package
Note: Right now there is a bug in 1.8.0, which is fixed in SVN and for 1.8.1, but debian-package fails under 12.04 LTS

# install (packages are one directory up)
$ sudo dpkg -i wireshark wireshark-common tshark

#now clean packages installed to resolve dependencies, but accept the second solution, leaving dependent packages intact:

$ sudo aptitude purge '?user-tag(wir)'

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages are BROKEN:
wireshark-common
The following packages will be REMOVED:
autoconf{p}...
...
...
... xtrans-dev{p}
0 packages upgraded, 0 newly installed, 92 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 114MB will be freed.
The following packages have unmet dependencies:
wireshark-common: Depends: libc-ares2 (>= 1.7.0) but it is not installable
Depends: libsmi2ldbl but it is not installable
The following actions will resolve these dependencies:

Remove the following packages:
tshark
wireshark
wireshark-common

Score is -463

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

Keep the following packages at their current version:
libc-ares2 [1.7.0-1 (lucid, now)]
libsmi2ldbl [0.4.8+dfsg2-2 (lucid, now)]

Score is -19930

Accept this solution? [Y/n/q/?] y