To install rustup in different directory (i.e. /opt):
- install rustup in custom directory pointed to by RUSTUP_HOME envvar:
curl https://sh.rustup.rs -sSf | RUSTUP_HOME=/home/kondanta/tools/rust/rustup CARGO_HOME=/home/kondanta/tools/rust/cargo sh -s -- -y- select default tool chain