I have installed Rust on my Manjaro system recently following these installation steps
To install Rust on Manjaro Linux, follow these steps:
Update Manjaro: Before installing Rust, ensure your system is up-to-date by running
sudo pacman -Syu
in the terminal[1].Install Rust: Use the following command to install Rust on Manjaro Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
[2].Activate Rust Environment: After installation, activate the Rust environment for your current shell using
source "$HOME/.local/share/cargo/env"
.To get started you need Cargo's bin directory (/home/user/.local/share/cargo/bin) in your PATH environment variable. This has not been done automatically. To configure your current shell, run: source "/home/user/.local/share/cargo/env" ❯ source "/home/user/.local/share/cargo/env" ❯ echo $PATH /home/user/.local/share/cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/home/user/.local/bin:/home/user/.cargo/bin:/home/user/.config/node_modules/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
- Verify Installation: Check if Rust is successfully installed by running
rustc -V
in the terminal.❯ rustc -V rustc 1.77.0-beta.5 (f2043422f 2024-02-17)
- Test Rust Installation: Create a test program like “Hello, World!” by creating a file named
main.rs
, addingfn main() { println!("Hello, World!"); }
, and compiling it withrustc main.rs && ./main
[1].❯ echo 'fn main() { println!("Hello, World!"); }' > main.rs rustc main.rs && ./main Hello, World!
Update Rust: Keep your Rust installation up-to-date with
rustup update
to get the latest features and security patches[2].Uninstall Rust: If needed, you can remove Rust from your system using
rustup self uninstall
[1].By following these steps, you can easily install, test, update, and remove Rust on your Manjaro Linux system.
Citations:
[1] https://www.linuxcapable.com/how-to-install-rust-on-manjaro-linux/
[2] Install Rust - Rust Programming Language
[3] rust
[4] What is the recommended way to install rust on Arch? / Applications & Desktop Environments / Arch Linux Forums
[5] Update replaces rustup with rust
Later when I tried to install a package that required Rust using the Pamac package manager, I got a message to “Choose a provider for cargo” and I have to choose between rust and rustup.
This made me wonder - what is the recommended way to install Rust on Manjaro Linux? Should I be using the command above to install rustup or installing from the repo with Pamac? And why did the package not recognize my existing rustup installation?
Any clarification would be appreciated so I can get Rust properly set up on my system.
Thanks!