RUST安裝

網頁直接訪問環境
https://play.rust-lang.org/

Rust安裝
[root@kolla ~]# cat /etc/resolv.conf
nameserver 8.8.8.8

[root@kolla ~]# yum install git curl gcc -y 

[root@kolla ~]# curl https://sh.rustup.rs -sSf | 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:

  /root/.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:

  /root/.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:

  /root/.profile
/root/.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'
476.2 KiB / 476.2 KiB (100 %) 223.0 KiB/s in  2s ETA:  0s
info: latest update on 2020-01-30, rust version 1.41.0 (5e1a79984 2020-01-27)
info: downloading component 'cargo'
  4.7 MiB /   4.7 MiB (100 %) 812.8 KiB/s in  6s ETA:  0s
info: downloading component 'clippy'
  1.8 MiB /   1.8 MiB (100 %)   1.2 MiB/s in  1s ETA:  0s
info: downloading component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)   2.4 MiB/s in  5s ETA:  0s
info: downloading component 'rust-std'
 17.5 MiB /  17.5 MiB (100 %)   4.0 MiB/s in  4s ETA:  0s
info: downloading component 'rustc'
 57.9 MiB /  57.9 MiB (100 %)   4.9 MiB/s in 11s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)   1.6 MiB/s in  7s ETA:  0s
info: installing component 'rust-std'
 17.5 MiB /  17.5 MiB (100 %)   6.6 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 57.9 MiB /  57.9 MiB (100 %)   7.9 MiB/s in 11s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable'

  stable installed - rustc 1.41.0 (5e1a79984 2020-01-27)


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


[root@kolla ~]# cat .cargo/config
[registry]
index = "https://mirrors.ustc.edu.cn/crates.io-index/"
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index/"
[root@kolla ~]#

[root@kolla ~]# source $HOME/.cargo/env
[root@kolla ~]# rustup --version
rustup 1.21.1 (7832b2ebe 2019-12-20)
發佈了201 篇原創文章 · 獲贊 28 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章