Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

Rust and emacs

install rust

  • install rust using rustup

This was performed on a Ubunutu Linux 19.10 system

# using rustup-init installer obtained via curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# for help
curl https://sh.rustup.rs -sSf | sh -s -- --help

# or use snap package
sudo snap install rustup --edge --classic

using recommended installer

❯ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to
Cargo's bin directory, located at:

  /home/user/.cargo/bin

This can be modified with the CARGO_HOME environment variable.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /home/user/.rustup

This can be modified with the RUSTUP_HOME environment variable.

This path will then be added to your PATH environment variable by
modifying the profile files located at:


  /home/user/.profile
/home/user/.zprofile
/home/user/.bash_profile

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-02-27, rust version 1.41.1 (f3e1a954d 2020-02-24)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)  10.7 MiB/s in  1s ETA:  0s
info: installing component 'rust-std'
info: installing component 'rustc'
 58.0 MiB /  58.0 MiB (100 %)  13.5 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable'

  stable installed - rustc 1.41.1 (f3e1a954d 2020-02-24)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done
automatically.

To configure your current shell run source $HOME/.cargo/env

See also:

using snap package (experimental)

rustup toolchain

rustup toolchain list

# without the option --no-self-update snap version will see an error:
# error: rustup is not installed at '/home/user/.cargo'
rustup toolchain install stable --no-self-update

which rustc
    /snap/bin/rustc
❯ rustup toolchain install stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-02-27, rust version 1.41.1 (f3e1a954d 2020-02-24)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
 58.0 MiB /  58.0 MiB (100 %)  13.3 MiB/s in  4s ETA:  0s
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)   7.3 MiB/s in  1s ETA:  0s

  stable-x86_64-unknown-linux-gnu installed - rustc 1.41.1 (f3e1a954d 2020-02-24)

error: rustup is not installed at '/home/user/.cargo'

❯ rustup toolchain uninstall stable
info: uninstalling toolchain 'stable-x86_64-unknown-linux-gnu'
info: toolchain 'stable-x86_64-unknown-linux-gnu' uninstalled

❯ sudo snap remove rustup
rustup removed

Rust emacs integration