How to Fix bash tshark Command Not Found in Minimal Linux

Network engineers, protocol analysts, and cloud infrastructure administrators routinely utilize tshark, the command-line packet dissection engine of the Wireshark suite, to capture, filter, and analyze live network traffic and PCAP traces directly from terminal sessions. On newly deployed minimal Linux installations, container base environments, or headless servers, attempting to execute the command yields: bash: tshark: command not found. This failure occurs because headless minimal distributions exclude packet dissection tools by default to minimize filesystem footprint.

Install tshark on Ubuntu, Debian, and Linux Mint

On Debian-derived systems, the utility is distributed through the official tshark package:

  1. Update your local package lists:
    sudo apt update
  2. Install tshark:
    sudo apt install -y tshark
  3. During installation, the debconf wizard will prompt: “Should non-superusers be able to capture packets?” Select Yes to enable packet sniffing without continuous root escalation.
  4. Add your standard user account to the wireshark group:
    sudo usermod -aG wireshark $USER
  5. Log out and log back in (or run newgrp wireshark) to refresh group memberships.
  6. Verify the command:
    tshark -v

Install tshark on RHEL, CentOS Stream, Rocky Linux, and Fedora

Enterprise Linux distributions bundle tshark inside the wireshark-cli package:

  1. On Fedora, install directly via dnf:
    sudo dnf install -y wireshark-cli
  2. On RHEL, AlmaLinux, or Rocky Linux, enable EPEL if required and install:
    sudo dnf install -y epel-release
    sudo dnf install -y wireshark-cli
  3. Verify the binary availability:
    tshark -v

Install tshark on Alpine Linux Containers

Lightweight Docker containers built on Alpine Linux provide tshark via the community repository:

  1. Update repository indexes:
    apk update
  2. Install the package:
    apk add tshark
  3. When running within a container, ensure raw socket capabilities are granted:
    docker run --cap-add=NET_RAW --cap-add=NET_ADMIN -it alpine

Install on Arch Linux and Manjaro

Arch Linux provides tshark within the wireshark-cli package in standard repositories:

  1. Synchronize repository indexes and install:
    sudo pacman -Sy wireshark-cli
  2. Add your user account to the wireshark group:
    sudo gpasswd -a $USER wireshark

Verify dumpcap Binary Permissions and Capabilities

If tshark is installed but returns permission errors when attempting to bind to network interfaces, check the Linux file capabilities on the capture engine:

  1. Inspect capabilities on the underlying capture binary:
    getcap /usr/bin/dumpcap
  2. If capabilities are missing, assign raw network permissions manually:
    sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.