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

相关推荐
杰 .23 分钟前
Linux yum_and_apt
linux·服务器
南棱笑笑生36 分钟前
20251129给荣品RD-RK3588开发板跑Rockchip的原厂Buildroot【linux-6.1】系统时适配AP6275P的蓝牙BLE
linux·运维·服务器·rockchip
c***21291 小时前
ubuntu 安装 Redis
linux·redis·ubuntu
u***32431 小时前
Mysql官网下载Windows、Linux各个版本
linux·数据库·mysql
小鹿学程序1 小时前
02-集群节点准备:克隆虚拟机
linux·服务器·apache
boligongzhu2 小时前
ubuntu20.04搭建YOLOv11 GPU运行环境
linux·yolo·ubuntu·机器人
c***72742 小时前
Linux下PostgreSQL-12.0安装部署详细步骤
linux·运维·postgresql
v***Y892 小时前
linux 设置tomcat开机启动
linux·运维·tomcat
松涛和鸣2 小时前
DAY20 Optimizing VS Code for C/C++ Development on Ubuntu
linux·c语言·开发语言·c++·嵌入式硬件·ubuntu