首页 > 其他分享 >Rust配置国内源,解决安装依赖慢问题

Rust配置国内源,解决安装依赖慢问题

时间:2024-07-29 12:51:35浏览次数:9  
标签:index 依赖 rsproxy cn io source https 安装 Rust

国内源使用字节的RsProxy https://rsproxy.cn/

配置环境变量

Mac

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

Windows

创建下面的系统环境变量

  1. 变量 RUSTUP_DIST_SERVER ,值 https://rsproxy.cn

  2. 变量 RUSTUP_UPDATE_ROOT ,值 https://rsproxy.cn/rustup

添加配置

新建配置文件

若对应的位置不存在 config 或者 config.toml 文件,手动新建即可。

  • Mac位置 ~/.cargo/config

  • Win位置 C:\Users\你的PC名\.cargo\config

配置文件内容如下【二选一】

[source.crates-io]
replace-with = 'rsproxy-sparse'
[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
[source.crates-io]
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

原文链接

Rust配置国内源,解决安装依赖慢问题

标签:index,依赖,rsproxy,cn,io,source,https,安装,Rust
From: https://www.cnblogs.com/LiangSenCheng/p/18329857/rust-proxy-turbo

相关文章

  • pip 安装错误:缺少 SOCKS 支持的依赖项
    当我尝试使用pipinstall时,它不断抛出此错误。$pipinstalldjangoERROR:CouldnotinstallpackagesduetoanOSError:MissingdependenciesforSOCKSsupport.我尝试安装request[socks],但随后出现错误,指出它无法识别袜子版本。以下是代理设......
  • Ubuntu Docker 安装 卸载
    1、使用脚本安装Dockerwget获取脚本并安装dockerwget-qO-https://get.docker.com/|sh2、启动docker后台服务sudoservicedockerstart3、卸载dockers要卸载Docker,你需要根据你的操作系统来选择合适的命令。以下是在不同操作系统中卸载Docker的方法。在Ubunt......
  • JDK的安装和配置
    JDK的安装和配置目录JDK的安装和配置JDK下载JDK安装配置环境变量JDK下载官网:https://www.oracle.com/cn/java/technologies/downloads![屏幕截图2024-07-25154834](D:\生产实习笔记\images\屏幕截图2024-07-25154834.png)点击JDKDownload进入详细下载页如下:把Accepet......
  • CentOS安装MySQL
    参考文章【CentOS安装mysql简单教程】https://blog.csdn.net/qq_50523945/article/details/131069683【运维系列:centos7yum安装使用时提示cannotfindavalidbaseurlforrepo:base/7/x86_64的解决方法(亲测有效☆)】https://blog.csdn.net/weixin_54626591/article/detai......
  • Django项目快速上手:从安装到创建应用
    Django项目快速上手:从安装到创建应用安装Django首先,确保你已经安装了Python和pip。然后,使用以下命令来安装Django:pipinstalldjango安装成功后,你就可以开始创建Django项目了。创建Django项目打开你的终端或命令提示符,然后使用django-admin命令来创建一个新的Djan......
  • 如果一个包需要安装早期版本,我该如何修改我的deploy.yml?
    这是我的文件:`名称:部署Shinylive应用程序:推:分支:[主要]拉请求:分支机构:[主要]工作:建造:running-on:ubuntu-lateststeps:-uses:actions/checkout@v2-name:SetupPythonuses:actions/setup-python@v4with:python-version:"3.10......
  • centos7.9 安装Hyperf 环境
    安装php7.4cat/etc/redhat-releaseyuminstallepel-releaserpm-Uvhhttps://rpms.remirepo.net/enterprise/remi-release-7.rpmyuminstall-yyum-utilsyum-config-manager--enableremi-php74yuminstall-yphpphp-fpmphp-cliphp-fpmphp-mysqlndphp-zipphp-d......
  • 安装 win32api 时出现此错误
    Collectingpypiwin32Usingcachedpypiwin32-223-py3-none-any.whl(1.7kB)Usingcachedpypiwin32-219.zip(4.8MB)Preparingmetadata(setup.py)...errorerror:subprocess-exited-with-error×pythonsetup.pyegg_infodidnotrunsuccessfully.......
  • ubuntu系统安装docker
    运行以下命令,更新软件包索引并安装添加Docker仓库所需的前置软件包:sudoaptupdatesudoapt-get-yinstallapt-transport-httpsca-certificatescurlsoftware-properties-common第2步:导入DockerGPG密钥使用以下命令下载并导入Docker阿里云的GPG密钥:curl-f......
  • 如何在GCP机器上安装pypiwin32模块?
    我想在python中导入win32com然后我使用pipinstallpypiwin32pipinstallpywin32python-mpipinstallpypiwin32python-mpipinstallpywin32导入,但是没有成功并收到错误通知Defaultingtouserinstallationbecausenormalsite-pac......