Install Cargo On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora And Raspbian

Install Cargo On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora And Raspbian

cargo

Rust package manager.
Manage Rust projects and their module dependencies (crates).

Maintainer: Rust Maintainers



Section: rust

Install cargo

  • Debian apt-get install cargo Click to copy
  • Ubuntu apt-get install cargo Click to copy
  • Alpine OS apk add cargo Click to copy
  • Arch Linux pacman -S cargo Click to copy
  • Kali Linux apt-get install cargo Click to copy
  • Fedora dnf install cargo Click to copy
  • Raspbian apt-get install cargo Click to copy

Rust package manager. Manage Rust projects and their module dependencies (crates).

How to use cargo?

Below are few example commands for cargo that you can use in the terminal.

Search for crates:
cargo search search_stringClick to copy
Install a crate:
cargo install crate_nameClick to copy
List installed crates:
cargo install --listClick to copy
Create a new binary or library Rust project in the current directory:
cargo init --bin|libClick to copy
Create a new binary or library Rust project in the specified directory:
cargo new path/to/directory --bin|libClick to copy
Build the Rust project in the current directory:
cargo buildClick to copy
Build with multiple parallel jobs:
cargo build -j jobsClick to copy
To install the latest version of cargo in your favorite operating system just copy the cargo installation command from above and paste it into terminal. It will download and install the latest version of cargo 2026 package in your OS.