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:
- Update your local package lists:
sudo apt update - Install tshark:
sudo apt install -y tshark - 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.
- Add your standard user account to the
wiresharkgroup:sudo usermod -aG wireshark $USER - Log out and log back in (or run
newgrp wireshark) to refresh group memberships. - 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:
- On Fedora, install directly via dnf:
sudo dnf install -y wireshark-cli - On RHEL, AlmaLinux, or Rocky Linux, enable EPEL if required and install:
sudo dnf install -y epel-release sudo dnf install -y wireshark-cli - 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:
- Update repository indexes:
apk update - Install the package:
apk add tshark - 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:
- Synchronize repository indexes and install:
sudo pacman -Sy wireshark-cli - 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:
- Inspect capabilities on the underlying capture binary:
getcap /usr/bin/dumpcap - If capabilities are missing, assign raw network permissions manually:
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap