在 Debian 上更新 dumpcap(通常是 Wireshark 的一部分)有几种常见方式,取决于你希望使用的版本来源。
sudo apt update
sudo apt install dumpcap
或升级所有系统包:
sudo apt upgrade
dumpcap --version
✅ 适合:对版本要求不高,使用 Debian 稳定版即可
如果你使用的是 Debian Stable(如 Debian 12 Bookworm),但想要更新的 dumpcap:
编辑或创建:
sudo nano /etc/apt/sources.list.d/backports.list
添加(以 Bookworm 为例):
deb http://deb.debian.org/debian bookworm-backports main
sudo apt update
sudo apt -t bookworm-backports install dumpcap
sudo apt install wget gnupg
wget -qO - https://www.wireshark.org/download/apt/key | sudo gpg --dearmor -o /usr/share/keyrings/wireshark-keyring.gpg
添加源(示例为 Debian 12):
echo "deb [signed-by=/usr/share/keyrings/wireshark-keyring.gpg] https://www.wireshark.org/download/apt stable main" | sudo tee /etc/apt/sources.list.d/wireshark.list
sudo apt update
sudo apt install dumpcap
sudo apt build-dep wireshark
git clone https://gitlab.com/wireshark/wireshark.git
cd wireshark
mkdir build && cd build
cmake ..
make
sudo make install
dumpcap 需要抓包权限:
sudo dpkg-reconfigure wireshark-common
选择 yes,将当前用户加入 wireshark 组:
sudo usermod -aG wireshark $USER
注销并重登录。
which dumpcap
dumpcap --version
如果你能告诉我:
cat /etc/os-release)我可以给你更精确的命令。