How to Install Rust on Fedora Linux

Last updated Friday, March 27, 2026 2:33 pm 7 min read 2 comments

Fedora’s own Rust packages already stay close to upstream, but nightly toolchains, extra targets, and user-managed updates still point many developers toward rustup. That difference matters when you install Rust on Fedora for active development work. Rust gives you the compiler, while Cargo handles project creation, dependencies, builds, and tests from the same terminal workflow.

Fedora 43 packages rust and cargo directly, and the official rustup installer works cleanly on the same release when you want the upstream toolchain manager instead. Fedora’s DNF packages currently ship Rust 1.94.0, while rustup resolves to the newer 1.94.1 stable toolchain. Both paths install Cargo, so you do not need a separate Cargo-only setup.

Install Rust on Fedora

Refresh package metadata first, then choose whether Fedora or rustup should manage the toolchain on this system.

sudo dnf upgrade --refresh

These commands use sudo for system-wide package management. If your account does not have sudo access yet, run the commands as root or follow the guide on how to add a user to sudoers on Fedora.

Install Rust on Fedora from the default repositories with sudo dnf install rust cargo, or use the official rustup installer when you want user-managed stable, beta, or nightly toolchains.

MethodChannelVersionUpdatesBest For
Fedora DNFFedora packagesFedora 43: 1.94.0dnf upgradeSystem-managed Rust, stable package maintenance, Fedora packaging parity
Official rustup installerrustup.rsCurrent stablerustup updateLatest stable first, nightly or beta toolchains, extra targets, upstream workflow

Pick one method unless you deliberately want both. Fedora packages and rustup can coexist, but rustc and cargo will follow whichever path wins on your PATH, which is why mixed installs often look inconsistent.

Fedora 43’s repositories shipped rustc 1.94.0, while rustup resolved to rustc 1.94.1. That keeps the DNF method perfectly usable for stable work, while rustup still lands first and adds the usual multi-toolchain workflow.

Fedora also packages a rustup bootstrap, but that RPM installs rustup-init rather than a ready-to-use rustup command. It also disables rustup self-update and rustup self-uninstall, so the official installer below is the cleaner rustup path when you want the standard upstream behavior.

Install Rust from Fedora DNF

Use Fedora’s packaged toolchain when you want system-managed Rust and Cargo through normal DNF maintenance.

Fedora packages Rust and Cargo separately, so install both packages together.

sudo dnf install rust cargo

Then check that both executables are available.

rustc --version && cargo --version
rustc 1.94.0 (4a4ef493e 2026-03-02) (Fedora 1.94.0-1.fc43)
cargo 1.94.0 (85eff7c80 2026-01-15) (Fedora 1.94.0-1.fc43)

This DNF path also brings in the compiler pieces a simple Cargo build needs, including gcc and make.

Install Rust with rustup on Fedora

Use rustup when you want the current stable toolchain, upstream documentation that matches your local compiler, or the option to add beta and nightly builds later.

Fedora Workstation usually already has curl, but server and minimal installs are more likely to need the full prerequisite set. Install gcc here as well, because a clean rustup install on Fedora 43 fails with linker `cc` not found until the system C toolchain is present.

sudo dnf install curl gcc

curl downloads the installer, and gcc provides the cc linker many Rust crates expect. If one of your projects also needs a generator step, install CMake on Fedora separately. The curl command guide breaks down the download flags in more detail.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

The sh -s -- -y portion accepts the default stable toolchain without pausing at the installer menu. Rerun the same command without -y if you want to choose a different profile or default toolchain.

Load Rust into the current shell so the toolchain works immediately.

source "$HOME/.cargo/env"

Then verify the rustup-managed toolchain.

rustc --version && cargo --version
rustc 1.94.1 (e408947bf 2026-03-25)
cargo 1.94.1 (29ea6fb6a 2026-03-24)

rustup tracks the current stable release, so newer installs will show newer version numbers than this example. On Fedora 43, rustup resolved to Rust 1.94.1.

Create a Test Rust Project on Fedora

A quick project build proves more than a version check because it exercises Cargo, the compiler, and the local linker in one pass.

cargo new ~/hello-rust --bin
cd ~/hello-rust
cargo run --quiet
Hello, world!

If you want version control around the same workflow, install Git on Fedora before you start committing crates.

Update or Remove Rust on Fedora

Use the subsection that matches how Rust was installed. DNF and rustup manage different files, and mixing their maintenance commands makes version conflicts harder to trace.

Update Rust installed from Fedora DNF

When Rust came from Fedora packages, keep it current with a normal DNF upgrade.

sudo dnf upgrade --refresh rust cargo

Update Rust installed with rustup on Fedora

When Rust came from rustup, let rustup refresh both the stable toolchain and the manager itself.

rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-update (current version: 1.29.0)
info: cleaning up downloads & tmp directories

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.94.1 (e408947bf 2026-03-25)

Remove Rust installed from Fedora DNF

DNF removes unused compiler dependencies automatically when they were installed only for the Rust stack.

Use sudo dnf remove --noautoremove rust cargo instead if you want to keep shared development packages such as gcc and make.

sudo dnf remove rust cargo

Confirm that both Fedora packages are gone.

rpm -q rust cargo
package rust is not installed
package cargo is not installed

Remove Rust installed with rustup on Fedora

The official rustup installer includes a full uninstall path for the user-space toolchain.

rustup self uninstall -y
info: removing rustup home
info: removing cargo home
info: removing rustup binaries
info: rustup is uninstalled

That command removes the rustup toolchains and the PATH lines rustup added to your shell startup files.

Verify that the toolchain directories are gone.

for path in "$HOME/.cargo" "$HOME/.rustup"; do
  [ -e "$path" ] && echo "still present: $path" || echo "removed: $path"
done
removed: /home/your-user/.cargo
removed: /home/your-user/.rustup

Fix Common Rust Issues on Fedora

Fresh Fedora installs usually run into one of three issues: the current shell has not loaded the rustup PATH change yet, both installation methods are competing for rustc, or rustup is missing the system linker.

Fix rustup command not found on Fedora

If the current shell still prints bash: rustup: command not found or bash: rustc: command not found right after a rustup install, check whether $HOME/.cargo/bin is already on your PATH.

bash: rustup: command not found

This check uses grep -Fx to match the path exactly. The grep command guide covers that syntax in more detail.

echo "$PATH" | tr ':' '\n' | grep -Fx "$HOME/.cargo/bin"
/home/your-user/.cargo/bin

If that command returns nothing, load the environment file in the current shell.

source "$HOME/.cargo/env"

Then verify the toolchain again.

rustc --version && cargo --version
rustc 1.94.1 (e408947bf 2026-03-25)
cargo 1.94.1 (29ea6fb6a 2026-03-24)

Fix DNF and rustup path conflicts on Fedora

When both installation methods exist on the same machine, the shell can keep using Fedora’s /usr/bin/rustc even after rustup installs a newer toolchain under ~/.cargo/bin.

The which command guide goes deeper on PATH resolution, but this quick check tells you which compiler wins.

which rustc

rustup path:

/home/your-user/.cargo/bin/rustc

Fedora DNF path:

/usr/bin/rustc

If which rustc still prints /usr/bin/rustc and you want rustup to stay in control, remove the DNF packages and reload the shell.

sudo dnf remove --noautoremove rust cargo
source "$HOME/.cargo/env"

Fix linker cc not found on Fedora

A clean rustup install on Fedora 43 fails to compile even a hello-world project when the system C toolchain is missing.

   Compiling hello-rust v0.1.0 (/home/your-user/hello-rust)
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: could not compile `hello-rust` (bin "hello-rust") due to 1 previous error

Install gcc, then rerun the project build.

sudo dnf install gcc

Confirm the project builds again.

cd ~/hello-rust
cargo run --quiet
Hello, world!

Rust on Fedora FAQ

Should you use DNF or rustup to install Rust on Fedora?

Use Fedora DNF when you want system-managed Rust and Cargo that move with normal package maintenance. Use rustup when you want the newest stable toolchain first, upstream-managed updates, or the option to add beta and nightly builds later.

Do you need to install Cargo separately on Fedora?

No. Fedora’s packaged method installs cargo alongside rust, and the official rustup installer includes Cargo in the default stable toolchain. If Rust is already on the machine, check with cargo --version before reinstalling anything.

Can you install rustup with DNF on Fedora?

Yes. Fedora 43 packages rustup, but that RPM installs the rustup-init bootstrap command rather than a ready-to-use rustup binary. That Fedora build also disables rustup self-update and rustup self-uninstall, which is why the official installer script remains the cleaner path when you want the standard upstream rustup workflow.

Does Rust work on Fedora Server and minimal installs?

Yes. The Rust toolchain is command-line software, so the same install commands work on Fedora Workstation, Server, and minimal installs. Server and minimal systems are simply more likely to need packages such as curl and gcc before the rustup path works cleanly.

Conclusion

Rust is ready on Fedora with either the system packages or the newer user-space toolchain from rustup. Keep your crates under version control with install Git on Fedora, add editor support with install Visual Studio Code on Fedora, and keep The Rust Book nearby as you move from hello-world binaries into larger services.

Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

2 thoughts on “How to Install Rust on Fedora Linux”

  1. Congratulations for the excellent website and useful guides. For install Rust+cargo I use the default script: curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh. Alternatively in Fedora i use in the terminal:

    # Rust
    sudo dnf in -y rustup
    rustup-init -y
    # Completions for Fish – For other shell see: https://rust-lang.github.io/rustup/installation/index.html
    mkdir -p ~/.config/fish/completions && rustup completions fish > ~/.config/fish/completions/rustup.fish

    Reply
    • Thanks for the feedback and the alternative installation methods! Both the rustup.rs script and the DNF approach are great options. I appreciate you sharing the Fish shell completions tip as well. It’s always helpful to have multiple ways to set up Rust on Fedora. Thanks again for contributing!

      Reply
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: