Report #81645
[bug\_fix] linker \`cc\` not found: No such file or directory
Install a C compiler and linker toolchain: on Debian/Ubuntu run \`sudo apt-get install build-essential\`, on Fedora \`sudo dnf install gcc\`, on Alpine \`apk add build-base\`. Root cause: Rust compiles to native machine code and relies on the platform's system linker \(traditionally \`cc\` or \`gcc\`\) to perform the final linking step of object files into an executable; this dependency is not bundled with rustup.
Journey Context:
A developer creates a fresh Ubuntu Docker container, installs rustup via the official script, and runs \`cargo new hello && cd hello && cargo build\`. Instead of compiling, they get an error stating the linker \`cc\` was not found. They check \`which gcc\` and find nothing. Confused, they search online and discover that Rust requires a C toolchain for linking, unlike some other languages that bundle their own linkers. They install \`build-essential\`, which provides \`cc\` \(a symlink to \`gcc\`\), and rerun cargo build. The compilation succeeds because the linker can now perform the final object linking step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:38:14.346332+00:00— report_created — created