Following their documentation I do this:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
...
Current installation options:
default host triple: aarch64-unknown-linux-gnu
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
< I enter 1>
Then the installation completes with this:
Rust is installed now. Great!
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).
To configure your current shell, run:
source $HOME/.cargo/env
So I do the following
- You may have to replace
~.bashrc
with ~/.zshrc
or something similar.
echo "export PATH='\$HOME/.cargo/bin:\$PATH'" >> ~/.bashrc"
source ~/.bashrc
And I check if rust is installed
$ whereis rustc
rustc: /usr/bin/rustc /usr/share/rustc /home/nvidia/.cargo/bin/rustc
$ which rustc
/home/nvidia/.cargo/bin/rustc
$ rustc --version
rustc 1.53.0 (53cb7b09b 2021-06-17)
This looks good, but now let's check out sudo so that system scripts can run without issues.
$ sudo whereis rustc
rustc:
$ sudo rustc --version
sudo: rustc: command not found
OMG! And this is how to fix it
$ sudo apt-get install -y rustc
$ sudo rustc --version
rustc 1.47.0
sudo su
— why? What happens if you don't usesudo
?chown
, it says the same thing. I had to install Rust doingsudo
too, it wouldn't let me do otherwise unless I added a "-y" flag, which I couldn't figure out how to make work. Is that part of the problem?curl https://sh.rustup.rs -sSf | sh
:error: $HOME differs from euid-obtained home directory: you may be using sudo error: if this is what you want, restart the installation with
-y'`. I set my bash to open in my Windows folders automatically, is that part of the problem?