Skip to content

Installing Libtrace

Shane Alcock edited this page Jun 22, 2026 · 11 revisions

Installing via binary package

Our binary packages for libtrace are hosted at https://libtrace.packages.nz (previously they are on Cloudsmith, please update your sources lists to change over to the new repository).

Debian / Ubuntu

Run the following command to install libtrace via https://libtrace.packages.nz

sudo apt-get install apt-transport-https curl

sudo rm -f /etc/apt/sources.list.d/wand-*.list         # only required if you're switching over from Cloudsmith, new users can skip this step

DISTRO_CODENAME=$(lsb_release -sc)
curl -fsSL https://packages.nz/repository-public-key.asc | sudo gpg --dearmor -o /etc/apt/keyrings/packages-nz.gpg
echo "deb [signed-by=/etc/apt/keyrings/packages-nz.gpg] https://libtrace.packages.nz/debian ${DISTRO_CODENAME} main" | sudo tee /etc/apt/sources.list.d/libtrace-packages-nz.list
sudo apt update
sudo apt-get install libtrace4 libtrace4-dev libtrace4-tools

Centos / RHEL / Rocky Linux / Alma Linux

Run the following commands to install libtrace via https://libtrace.packages.nz

# First remove any references to the old cloudsmith repositories
sudo rm /etc/yum.repos.d/wand-*.repo

DISTRO_SUFFIX=$(rpm --eval '%{dist}' | tr -d '.')
DISTRO_VERSION=$(echo "$DISTRO_SUFFIX" | tr -d -c '0-9')

sudo -E dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${DISTRO_VERSION}.noarch.rpm
sudo /usr/bin/crb enable

cat << EOF > /tmp/packages-nz-libtrace.repo
[libtrace]
name=Libtrace Repository from packages.nz
baseurl=https://libtrace.packages.nz/redhat/${DISTRO_SUFFIX}/x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.nz/repository-public-key.asc
EOF

sudo cp /tmp/packages-nz-libtrace.repo /etc/yum.repos.d/

sudo dnf install libtrace4 libtrace4-devel libtrace4-tools

Building from source

Required Software:

  • automake-1.9
  • libpcap-0.8
  • flex and bison
  • pkg-config
  • libwandio

Optional Software:

  • DAG libraries (required if you wish to capture using a DAG card)
  • llvm-dev, llvm-gcc-4.2 and libboost-dev (required for using the BPF-JIT code)
  • libncurses (for the tracetop tool)
  • libssl-dev (for the traceanon tool)
  • libyaml (required for traceanon)
  • libwandder (required for ETSI LI decoding)
  • dpdk-dev and libnuma-dev (required to have DPDK support)
  • libbpf and libelf-dev (required for XDP support)
  • libbpf, clang and llvm (required to build XDP eBPF program)

Compiling and Installing Libtrace

If you've cloned the libtrace repository on GitHub, you'll need to run ./bootstrap.sh before attempting to build libtrace.

The following sequence of commands will build and install libtrace on most systems:

    ./configure
    make
    sudo make install

By default, libtrace will install to /usr/local ; this can be changed by adding --prefix= to the configure line. Other configuration options, if required, can be viewed by running ./configure --help.

The BPF-JIT functionality is disabled by default - you will need to add --with-llvm to your configure line to enable it. Note that you will require llvm-dev, llvm-gcc-4.2 and libboost-dev. Even then, it may not work if these (particularly llvm-gcc-4.2) have been installed in unexpected locations.

Following installation, you may need to add the line '/usr/local/lib' to your /etc/ld.so.conf and run 'ldconfig' as root.

Known Issues

Building libtrace on older installs of Mac OS X (we observed this on 10.4.11) may produce the following error: ERROR: No debug map or DWARF data was found to link.

This appears to be due to a bug in the dsymutil linker. Upgrading the dev environment to Xcode 2.5 or later should fix this problem.

Clone this wiki locally