ubuntu安装rust教程

参考【Rust】Linux上安装Rust开发环境

shell 复制代码
sudo apt-get install curl


# 注意,不开代理很可能下不到,一直报403
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup


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

然后就会弹出来一堆字,选1是不自定义路径(默认设置),因为我是在虚拟机上玩,所以就选一

配置环境变量

shell 复制代码
vim ~/.profile
export PATH="$HOME/.cargo/bin:$PATH
source ~/.profile
rustc --version

vscode插件推荐

  • rust-analyzer
  • Even Better Toml
  • crates
  • Bookmarks
  • Tabnine
  • rust syntax

配置代码格式化
VSCode保存自动格式化代码-Prettier - Code formatter

相关推荐
YMWM_1 天前
linux文件快速传windows
linux·运维·服务器
星竹晨L1 天前
Linux开发工具入门(一):开发三板斧(包管理器,vim,gcc/g++) 以及入门理解动静态库
linux·运维·服务器
sunxunyong1 天前
CGroup配置
linux·运维·服务器
hy____1231 天前
Linux_网络编程套接字
linux·运维·网络
若风的雨1 天前
【deepseek】 Linux 调度延时分析
linux
2301_803554521 天前
linux 以及 c++编程里对于进程,线程的操作
linux·运维·c++
LuDvei1 天前
windows 中 vs code远程连接linux
linux·运维·服务器·windows
GDAL1 天前
MANIFEST.in简介
linux·服务器·前端·python
点点滴滴的记录1 天前
Redis部署在Linux上性能高于Windows
linux·数据库·redis
蜕变的小白1 天前
基于Linux的天气查询项目
linux·运维·服务器