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

相关推荐
星恒随风30 分钟前
MySQL 从零入门(十):MVCC、Undo Log 与 Read View 详解——InnoDB 如何实现事务隔离?
linux·数据库·笔记·sql·mysql
瑞雪兆丰年兮2 小时前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
咋的啥名都用不了呢~4 小时前
Linux项目部署6(安装Elasticsearch)
linux
无奈笑天下5 小时前
银河麒麟桌面上USB打印机无法打印问题标准处理流程
linux·运维·网络协议
15Moonlight6 小时前
Linux 网络(11):IO 多路转接(select /poll/epoll)
linux·网络
wno7047 小时前
CentOS下FTP服务搭建
linux·运维·centos
15Moonlight8 小时前
Linux网络(12):Reactor 模式
linux·网络
wflynn8 小时前
GitHub 今日推荐|rust-anything:录制真实输入输出,渐进式重写热点函数到 Rust
rust·开源·github·cli·claude-code·agent-skills
思想觉悟9 小时前
Android启动流程之点rc文件
android·linux·面试
kyle~20 小时前
嵌入式 SoC 系统
linux·c++·嵌入式·计算系统