Report #80081
[bug\_fix] linker \`cc\` not found: No such file or directory
Install the system C compiler and linker toolchain using the distribution's package manager \(e.g., \`sudo apt-get install build-essential\` on Debian/Ubuntu\).
Journey Context:
Developer spins up a fresh Docker container using \`ubuntu:latest\` or \`debian:slim\`, installs Rust via rustup, clones a repository, and runs \`cargo build\`. The compilation proceeds through the dependencies but fails at the final linking stage with "linker \`cc\` not found". Developer checks \`which rustc\` \(works\) and \`which cargo\` \(works\), then checks \`which cc\` \(returns nothing\). They realize the image only has the Rust toolchain but no C toolchain. They try \`apt-get install gcc\`, which installs the compiler but still leaves \`cc\` missing or without libc headers. They search and find that Rust requires the full build environment including \`make\`, \`libc-dev\`, and the linker wrapper. Installing \`build-essential\` on Debian-based systems provides the \`cc\` symlink to \`gcc\` and all necessary headers, immediately resolving the linker error on the next cargo build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:01:34.226600+00:00— report_created — created