Rust
How to install Rust on your system.
Install
You can check official guide for more information.
Download installer and press Enter to install Rust with default settings.
sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shPress Enter to continue.
sh
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>output
After successful installation, you will see this message.
sh
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).output
So you need to restart your shell, you can just exit SSH session and reconnect.
Commands
Version
Check Rust version.
sh
rustc -vVCargo
You can use cargo to manage Rust packages like installing, compiling, running, updating, and more.
sh
cargo --versionUpdate
You can update Rust with rustup.
sh
rustup updateUninstall
You can uninstall Rust with rustup.
sh
rustup self uninstallErrors
If you have an error like rustc: command not found, you can check if cargo is in ~/.zshrc.
sh
cat ~/.zshrcIf it's not there, you can add it.
sh
vim ~/.zshrcsh
export PATH=$HOME/.cargo/bin:$PATHsh
source ~/.zshrc