阿里云liunx服务器安装rust

安装

执行命令:

curl -sSf https://sh.rustup.rs | sh

执行如下

[root@izwz9938t1plpjxsy3riqdz /]# curl https://sh.rustup.rs -sSf | sh -s
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 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
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1  #选择默认安装方式

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2018-11-08, rust version 1.30.1 (1433507eb 2018-11-07)
info: downloading component 'rustc'
 76.4 MiB /  76.4 MiB (100 %) 979.7 KiB/s ETA:   0 s                
info: downloading component 'rust-std'
 41.9 MiB /  52.8 MiB ( 79 %) 1016.8 KiB/s ETA:  11 s                52.8 MiB /  52.8 MiB (100 %)   1.4 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.4 MiB /   4.4 MiB (100 %)   1.1 MiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  8.9 MiB /   8.9 MiB (100 %)   1.1 MiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'

  stable installed - rustc 1.30.1 (1433507eb 2018-11-07)


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 automat

2.重开一个会话输入命令rustc --version显示如下说明安装成功

[root@izwz9938t1plpjxsy3riqdz ~]# rustc --version
rustc 1.30.1 (1433507eb 2018-11-07)

配置科大rust源

  1. 使用命令vi /root/.cargo/config创建一个config文件 并打开文件
  2. 在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/"

3.保存退出

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值