Report #54182
[bug\_fix] error: linker \`cc\` not found / linker 'cc' not found: No such file or directory
Install the C compiler toolchain. On Debian/Ubuntu: \`sudo apt-get install build-essential\`. On Fedora: \`sudo dnf install gcc\`. On macOS: \`xcode-select --install\`. On Alpine Linux: \`apk add build-base\`. Root cause: Rust relies on a system C linker \(\`cc\`, usually gcc or clang\) to link object files into final binaries. Minimal containers or fresh VMs often lack this.
Journey Context:
Developer creates a new Docker container from \`ubuntu:latest\` or \`debian:slim\`. They install rustup with \`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \| sh\`. They source their profile and run \`cargo new hello\_world && cd hello\_world && cargo run\`. The compilation proceeds to the linking stage and fails with "linker \`cc\` not found". The developer realizes they only installed Rust, not the C toolchain. They run \`apt-get update && apt-get install -y build-essential\` \(or equivalent for their distro\), retry \`cargo run\`, and the binary links successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:26:33.977032+00:00— report_created — created