Tauri "webkit2gtk ... not found" missing system deps on Linux in CI
Tauri's Linux webview links against WebKitGTK via pkg-config. On a fresh runner the -dev packages are absent, so the build of webkit2gtk-sys fails before any Rust compiles.
What this error means
cargo/tauri build fails with "The system library webkit2gtk-4.1 required by crate webkit2gtk-sys was not found" or a pkg-config error for libsoup/javascriptcoregtk.
error: failed to run custom build command for `webkit2gtk-sys v2.0.1`
The system library `webkit2gtk-4.1` required by crate `webkit2gtk-sys`
was not found. The PKG_CONFIG_PATH environment variable is not set.Common causes
WebKitGTK dev packages are not installed
pkg-config cannot find webkit2gtk-4.1 because the -dev library is missing from the runner image.
Other Tauri Linux deps also missing
Tauri also needs libsoup, librsvg, libappindicator, and GTK dev headers; any missing one fails the build command.
How to fix it
Install Tauri's Linux dependencies
Add the documented system packages before building on Ubuntu.
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev \
librsvg2-dev libappindicator3-dev patchelfMatch the package to the Tauri webview version
Tauri v1 uses webkit2gtk-4.0; Tauri v2 uses 4.1. Install the one your version expects.
# Tauri v1
sudo apt-get install -y libwebkit2gtk-4.0-devHow to prevent it
- Install all documented Linux deps in a setup step.
- Match the webkit2gtk version to your Tauri major version.
- Bake the dependencies into a custom runner image to save time.