美文网首页
在Linux/MAC中安装Rust到自定义路径

在Linux/MAC中安装Rust到自定义路径

作者: 吾等斩去红尘时 | 来源:发表于2023-05-28 11:23 被阅读0次

设置环境变量

~/.zshrc

###
# rust
###
export RUSTUP_HOME="$HOME/snap/rust/rustup"
export CARGO_HOME="$HOME/snap/rust/cargo"
export PATH="$PATH:$CARGO_HOME/bin"

安装程序

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

卸载程序

rustup self uninstall

镜像加速

更新版本(rustup)

~/.zshrc

export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

社区第三方库(crates)

/home/yourname/snap/rust/cargo/config

[source.crates-io]
# To use sparse index, change 'rsproxy' to 'rsproxy-sparse'
replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

相关文章

网友评论

      本文标题:在Linux/MAC中安装Rust到自定义路径

      本文链接:https://www.haomeiwen.com/subject/ryqdedtx.html