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

相关推荐
蜡笔婧萱16 小时前
Linux--远程登录服务ssh
linux·服务器·ssh
伏加特遇上西柚16 小时前
Loki+Alloy+Grafana日志采集部署
java·linux·服务器·spring boot·grafana·prometheus
资源分享助手17 小时前
三网H5小游戏战车向前冲搭建教程(Win+Linux)
linux·运维·服务器
黑白园17 小时前
Linux i2c驱动初探(一)待补充
linux
无限进步_17 小时前
Linux权限模型:从rwx到粘滞位
linux·运维·服务器
SWAGGY..18 小时前
Linux系统编程:(一)基础指令详解
linux·运维·服务器
一池秋_18 小时前
etc/sudo.conf is owned by uid 10258, should be 0解决
linux·运维·服务器
dingdingfish18 小时前
TLPI 第19 章 练习:Monitoring File Events
linux·inotify·tlpi·exercise
Bert.Cai18 小时前
Linux basename命令详解
linux·运维·服务器
源远流长jerry18 小时前
Linux 本机网络通信机制深度解析:Loopback 设备原理
linux·运维·服务器·网络·tcp/ip·nginx·负载均衡