rust linux安装

今天安装MeiliSearch的时候要用到 rustup,提示说是没有此命令,上网一查说是需要安装rust环境,rustup是用来安装rust的扩展的。

执行以下命令就可以安装了

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

当看到有提示:Current installation options:

default host triple: x86_64-unknown-linux-gnu

     default toolchain: stable (default)

               profile: default

  modify PATH variable: yes

1) Proceed with installation (default)

2) Customize installation

3) Cancel installation

选择1就可以了。按照默认的安装就可以了

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

执行这个命令就可以了 source $HOME/.cargo/env

国内访问rustup比较慢,可以执行以下两个命令来指定镜像的源

export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup

也可以参考文章:https://learnku.com/articles/49977 来修改

You May Also Like