Report #101967
[bug\_fix] error: linker \`cc\` not found \| = note: No such file or directory \(os error 2\)
Install a C toolchain so that \`cc\` \(or \`gcc\`/\`clang\`\) is on PATH. On Debian/Ubuntu run \`sudo apt install build-essential\`; on Fedora \`sudo dnf install gcc\`; on macOS run \`xcode-select --install\`; on Alpine run \`apk add build-base\`.
Journey Context:
You install Rust with rustup in a fresh Docker container, WSL instance, or CI runner, then run \`cargo build\` on a crate that depends on \`libc\` or any \`-sys\` crate. Compilation fails immediately with \`linker 'cc' not found\` even though rustc itself is installed. The message is from the final link step: rustc invokes the system linker, which on Unix is typically \`cc\`, and the binary is missing. You verify with \`which cc\`. After installing the distribution's C development package, \`cc\` exists, rustc links the crate, and subsequent builds succeed. The same fix applies whenever a crate has a build script that compiles native code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:44:46.277762+00:00— report_created — created