
You cloned a Rust project from GitHub, ran cargo build, and hit a wall immediately. Either you got error: linker 'cc' not found, or cargo was not found at all. This is one of the most common stumbling blocks when you try to install Rust on Fedora 44 for the first time, and it happens because Fedora does not ship Rust out of the box on minimal and server installs.
This guide covers everything you need to set up a working Rust development environment on Fedora 44. You will learn two installation methods, understand why each command matters, verify that compilation actually works end-to-end, and fix the three errors that trip up most people. By the end, you will have a functional Rust toolchain ready for real projects.
Fedora 44 is a strong base for Rust development. It ships with Linux kernel 6.14, DNF5 as the package manager, and a modern glibc. Both installation paths covered here, DNF and rustup, resolve to Rust 1.95.0 on Fedora 44 as of the current stable release cycle.
Prerequisites
Before you run a single command, confirm these requirements are in place. Skipping this step causes confusing errors later.
- Operating System: Fedora 44 (Workstation, Server, or minimal install)
- User Permissions: A user account with
sudoaccess, or direct root access - Internet Connection: Required for both methods; rustup downloads the toolchain live
- Disk Space: At least 600 MB free in your home directory for a rustup install; DNF packages use less but need space in
/usr - Terminal Access: A local terminal or SSH session to your Fedora machine
- curl installed: Needed for the rustup method; verify with
curl --version
If you are on a Fedora 44 minimal install or Fedora Server, you are more likely to be missing curl and gcc than on Fedora Workstation. The prerequisite step in Method 2 covers that explicitly.
Step 1: Update Your System Before You Start
Always refresh your system before installing a compiler toolchain. This is not optional hygiene; it is a hard requirement.
Fedora 44 uses DNF5, the new default package manager. Outdated glibc, gcc, or kernel headers can cause silent ABI mismatches when Rust compiles crates that include C code. Running a system update first eliminates that entire class of problem before it starts.
Run the following command:
sudo dnf upgrade --refresh
The --refresh flag forces DNF5 to sync repository metadata from the mirrors before checking for upgrades. Without it, DNF can use a stale cache and skip updates that were released in the last few hours. This matters because Fedora’s Rust package is actively maintained and may have received a security update or build fix recently.
Wait for the upgrade to complete, then reboot if the kernel was updated:
sudo reboot
Why reboot? If the kernel was upgraded, your running kernel and the installed kernel headers will be different versions. Some Rust crates that compile C extensions use kernel headers at build time. Rebooting ensures the running kernel and headers match.
Step 2: Choose Your Installation Method
This is the decision that affects every Rust workflow you run on this machine. Pick the wrong one and you will fight PATH conflicts and version mismatches for as long as Rust is installed.
Fedora 44 supports two paths: the DNF package method and the rustup method. Here is the real difference between them.
| Feature | DNF | rustup |
|---|---|---|
| Rust version | 1.95.0 (locked to Fedora 44 cycle) | 1.95.0 stable, plus beta and nightly |
| Update command | sudo dnf upgrade |
rustup update |
| Install location | /usr/bin/rustc |
~/.cargo/bin/rustc |
| Multiple versions | No | Yes |
| Extra tools (Clippy, rustfmt) | Separate RPM packages | rustup component add |
| Best use case | Servers, CI pipelines, scripting | Active development, open-source contribution |
Use DNF when you manage a Fedora server and want dnf upgrade to handle all software including the Rust compiler as a single command. Consistency matters more than cutting-edge versions in that environment.
Use rustup when you are building projects from crates.io, contributing to Rust code, or working with any project that has a rust-toolchain.toml file specifying a required version. Rustup is also the right choice when you need rust-analyzer, clippy, or rustfmt at versions that match your compiler.
Do not install both methods as your primary toolchain on the same machine. They can physically coexist, but rustc and cargo will follow whichever path wins the PATH resolution order, and that inconsistency produces errors that are genuinely difficult to diagnose.
Step 3: Method 1 — Install Rust on Fedora 44 Using DNF
This method takes two commands. Use it for server deployments and environments where package uniformity matters.
Install the Compiler and Cargo
Fedora packages rustc (the compiler) and cargo (the build tool and package manager) as separate RPMs. You need both. Installing only rust leaves you without cargo, which means you cannot create projects, manage dependencies, or run builds.
sudo dnf install rust cargo
Why install both explicitly? DNF does not install cargo as a dependency of rust automatically in all configurations. Specifying both names in one command is cleaner and avoids discovering a missing cargo when you try to scaffold your first project.
Verify the Installation
rustc --version && cargo --version
Expected output:
rustc 1.95.0 (59807616e 2026-04-14) (Fedora 1.95.0-1.fc44)
cargo 1.95.0 (f2d3ce0bd 2026-03-21) (Fedora 1.95.0-1.fc44)
Notice the (Fedora 1.95.0-1.fc44) tag at the end. That tag confirms you are running the Fedora-patched and Fedora-managed build of the compiler, not a rustup-managed one. If you later install rustup on the same machine, this tag is your indicator that the DNF binary is winning the PATH race.
Confirm Which Binary the Shell Uses
command -v rustc
Expected output: /usr/bin/rustc
Why run this check? On a machine where someone previously used rustup, the shell might still have ~/.cargo/bin earlier in the PATH. If command -v rustc points to ~/.cargo/bin/rustc, the DNF install did not take effect in the active shell. Restart the terminal or source your profile to resolve it.
Step 4: Method 2 — Configure Rust on Fedora 44 Using rustup
This is the recommended path for developers. Rustup manages everything in your home directory and never touches system files, which means you can install, update, and remove toolchains without sudo.
Install Build Prerequisites
On a fresh Fedora 44 minimal install or Fedora Server, curl and gcc are not always present. Install them before running the rustup installer.
sudo dnf install curl gcc
Why curl? The rustup installer is fetched as a shell script from https://sh.rustup.rs. Without curl, there is no way to download it.
Why gcc before you even write a single line of Rust? Rust’s compiler produces object files that still need to be linked into a final binary by a C linker (cc). Even a pure Rust project with zero C dependencies goes through this linker step. On Fedora 44, the linker is provided by gcc. Without it, your very first cargo run will fail with error: linker 'cc' not found even though the Rust compiler itself installed correctly.
Installing gcc now prevents that error entirely instead of having to diagnose it after the fact.
Download and Run the rustup Installer
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
This is the official installation command from rust-lang.org. Each flag here serves a specific security or automation purpose.
Breaking down the flags:
--proto '=https': Forces curl to use only HTTPS. This prevents the installer from downloading over plain HTTP if the server redirects, even accidentally.--tlsv1.2: Sets TLS 1.2 as the minimum acceptable protocol version. This blocks TLS downgrade attacks where a network attacker forces your client to negotiate an older, weaker protocol.-sSf: Silent mode (-s), show errors if they occur (-S), and fail the command on HTTP errors (-f) rather than silently downloading an error page.sh -s -- -y: Passes the-yflag to the installer script to accept the default stable toolchain without stopping at the interactive confirmation prompt. Remove-yif you want to manually choose the installation profile (minimal, default, or complete).
Load Rust Into Your Current Shell
source "$HOME/.cargo/env"
Why is this step mandatory and not optional? The rustup installer modifies ~/.bashrc (for bash) or ~/.zshrc (for zsh) to add ~/.cargo/bin to your PATH. However, those file changes only take effect in a new shell session opened after the install. The shell you used to run the installer does not reload its profile automatically.
Without running source "$HOME/.cargo/env", every command you type next (rustc, cargo, rustup) will return command not found, even though the installation succeeded completely. Sourcing the env file patches the current session immediately.
Verify the rustup-Managed Toolchain
rustc --version && cargo --version
Expected output:
rustc 1.95.0 (59807616e 2026-04-14)
cargo 1.95.0 (f2d3ce0bd 2026-03-21)
Notice that this output does NOT have the (Fedora ...) suffix. The absence of that tag confirms rustup is managing this toolchain, not DNF.
Run one more command for deeper verification:
rustup show
This displays the active toolchain, all installed components, and the host triple (e.g., x86_64-unknown-linux-gnu). It is more informative than --version alone because it shows you exactly what rustup considers the active environment and where it is installed.
Step 5: Build a Test Project to Verify Your Rust on Fedora 44 Setup
A version number check proves the binary exists. A full project build proves that the compiler, Cargo, and the linker all work together as a complete toolchain. Always run this step.
Create and Run a New Project
cargo new ~/hello-rust --bin
cd ~/hello-rust
cargo run
Why --bin? This flag tells Cargo to scaffold a binary executable project with a fn main() entry point in src/main.rs. Without it, Cargo creates a library project by default, which does not produce a runnable binary.
Expected output:
Compiling hello-rust v0.1.0 (/home/youruser/hello-rust)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.68s
Running `target/debug/hello-rust`
Hello, world!
What cargo run actually tests: It compiles src/main.rs with rustc, invokes the system linker (cc from gcc) to produce the binary, and then executes it. If any part of the toolchain is broken, it fails here with a clear, specific error. This single command exercises the entire pipeline.
Run a Fast Syntax Check
cargo check
Why cargo check matters: cargo check performs full type checking and borrow checking without generating any machine code or calling the linker. It finishes roughly 3 to 10 times faster than cargo build on larger projects. During active development, running cargo check after every file save gives near-instant feedback on errors without waiting for a full compile.
Get in the habit of using cargo check during development and cargo build when you need the actual binary.
Step 6: Install Development Tools (Clippy, rustfmt, rust-analyzer)
The base Rust install gives you the compiler and Cargo. Productive development also requires a linter, a formatter, and a language server. Rustup handles all three as components.
Clippy (The Linter)
rustup component add clippy
Run it on your project:
cargo clippy
Why Clippy matters for new Rust developers: The Rust compiler enforces memory safety and type correctness, but it allows a lot of code that is technically valid yet practically problematic. Clippy catches common beginner patterns that compile fine but indicate a misunderstanding of Rust idioms. Running cargo clippy before pushing code is standard practice in any Rust project.
rustfmt (The Formatter)
rustup component add rustfmt
Format your project:
cargo fmt
Why install this from rustup, not DNF? The Fedora RPM for rustfmt may not always match the compiler version you are running. When using rustup, rustup component add rustfmt installs the formatter that was built alongside your active compiler. Version mismatches between formatter and compiler can cause subtle style rule differences.
rust-analyzer (The Language Server)
rustup component add rust-analyzer
Why install this via rustup component rather than downloading a binary separately? rust-analyzer must match the exact compiler version to provide accurate diagnostics, refactoring, and code completion. Installing it as a rustup component guarantees automatic version alignment every time you run rustup update. If you install a standalone binary and then update the compiler, the language server falls out of sync and starts reporting false errors.
Step 7: Keep Rust Updated and Remove It Cleanly
Update Using DNF
sudo dnf upgrade --refresh rust cargo
The --refresh flag prevents DNF5 from skipping updates because of a stale metadata cache.
Update Using rustup
rustup update
rustup update updates all installed toolchains (stable, beta, nightly if you have them) and also updates rustup itself. Run this weekly during active development to stay current with security patches.
Remove Rust (DNF Method)
sudo dnf remove --noautoremove rust cargo
Why --noautoremove? By default, dnf remove also removes packages that were installed as automatic dependencies and are no longer needed by anything else. On a development machine, gcc and make are often pulled in for Rust but used by many other tools. The --noautoremove flag removes only rust and cargo, leaving shared dev tools intact.
Remove Rust (rustup Method)
rustup self uninstall -y
This removes all toolchains stored in ~/.rustup, the entire ~/.cargo directory, and the PATH lines that rustup injected into your shell profile files. Your system gcc and other Fedora packages remain untouched.
Troubleshooting: 3 Common Errors When You Install Rust on Fedora 44
Error 1: bash: rustc: command not found Right After Installation
What happened: The installation succeeded, but the shell that ran the installer has not reloaded its profile. The ~/.cargo/bin directory is not yet in this session’s PATH.
Fix:
source "$HOME/.cargo/env"
Then verify:
rustc --version
If you open a new terminal window and it also shows command not found, check that the installer wrote to ~/.bashrc:
grep cargo ~/.bashrc
If nothing appears, re-run the rustup installer.
Error 2: error: linker 'cc' not found on First Cargo Build
What happened: Rust is installed but gcc is not. The linker that converts Rust object files into a runnable binary is missing. This is the single most common error on Fedora 44 minimal and Server installs.
Fix:
sudo dnf install gcc
Then retry the build:
cargo run
Why gcc and not something else? On Linux, Rust uses the system C linker by default. Fedora provides that linker through the gcc package. Installing gcc also brings in binutils, which includes ld, the actual linker executable. Both are required.
Error 3: DNF and rustup PATH Conflict (Wrong Version Active)
What happened: Both installation methods exist on the machine. The shell resolves rustc to the DNF-managed binary at /usr/bin/rustc even though rustup is installed.
Diagnose it:
command -v rustc
If the output is /usr/bin/rustc and you want rustup to be in control, run:
sudo dnf remove --noautoremove rust cargo
source "$HOME/.cargo/env"
command -v rustc
Expected output after the fix: /home/youruser/.cargo/bin/rustc
Why --noautoremove again? Removing rust via DNF without this flag can pull out gcc and make as auto-installed dependencies, which breaks the very linker that rustup’s toolchain needs. Always use --noautoremove when uninstalling Rust packages from DNF on a dev machine.
[su_box title=”VPS Manage Service Offer” style=”bubbles” box_color=”#000000″ radius=”10″]If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal![/su_box]