Report #9069
[bug\_fix] Linker \`cc\` not found \(linker error on Linux\)
Install the C compiler toolchain: on Debian/Ubuntu run \`sudo apt-get install build-essential\`, on Fedora \`sudo dnf install gcc\`, or install \`clang\`. This provides the \`cc\` symlink that Cargo invokes to link binaries.
Journey Context:
Developer spins up a fresh Ubuntu 22.04 Docker container or WSL instance, installs Rust via rustup \(\`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \| sh\`\), creates a new project with \`cargo new hello\`, and runs \`cargo build\`. Instead of success, they get a cryptic error: \`error: linker 'cc' not found\`. They search online and find conflicting advice about installing gcc, clang, or build-essential. They try \`apt-get install gcc\` which installs the compiler but the error persists because the \`cc\` symlink is missing. They realize \`build-essential\` is the meta-package that includes gcc, make, and the cc symlink. After installing it, cargo successfully invokes the linker to produce the binary. The root cause is that Rust compiles to LLVM IR and then relies on a system linker \(traditionally \`cc\`\) to produce the final executable, and minimal Linux images lack this C toolchain component.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:13:38.641356+00:00— report_created — created