Report #66714
[bug\_fix] linker \`cc\` not found
Install the full C development toolchain: \`sudo apt-get install build-essential\` on Debian/Ubuntu, \`sudo dnf groupinstall "Development Tools"\` on Fedora, or \`sudo pacman -S base-devel\` on Arch.
Journey Context:
Developer provisions a fresh cloud server \(Ubuntu 22.04 LTS\) for CI/CD. They install Rust via rustup: \`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \| sh\`. They source the environment and run \`cargo new hello && cd hello && cargo run\`. Immediately they hit the error: \`error: linker 'cc' not found: No such file or directory \(os error 2\)\`. They check \`which gcc\` and get nothing. They think the Rust installation is corrupted. They try reinstalling rustup with different toolchains \(stable vs nightly\) but the error persists. They search the error message and find GitHub issues on rust-lang/rust explaining that Rust requires a system linker \(\`cc\`, \`gcc\`, or \`clang\`\) to link object files and standard libraries into the final binary. They try \`sudo apt install gcc\` but still get errors about missing \`ld\` or \`crti.o\`. Finally, they find the canonical solution: install \`build-essential\` which provides \`gcc\`, \`g\+\+\`, \`make\`, \`ld\`, and the C standard library headers. After \`sudo apt-get install build-essential\`, \`cargo build\` successfully invokes the linker and produces the binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:27:37.071798+00:00— report_created — created