linux系统下vscode portable版本的rust环境搭建004:rust

  • 目的:希望在获得一个新的系统之后,以最简便快速的方式搭配一个rust的编程环境
  • 命令在线安装只执行这句就行了curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh,因为是要portable安装所以按照以下的方式执行。

下载

安装

复制代码
#!/bin/bash
sudo apt install build-essential
rust_folder="rust-1.68.2-x86_64-unknown-linux-gnu"

if [ -d "$rust_folder" ]; then
    echo "rust folder already exists."
else
    tar -xzvf rust-1.68.2-x86_64-unknown-linux-gnu.tar.gz
fi
mkdir ./rustlang
./$rust_folder/install.sh --destdir=./rustlang

$ echo 'export PATH="./rustlang/usr/local/bin:$PATH"' >> ~/.bashrc
$ source ~/.bashrc
$ cargo -V
$ rustc -V

相关错误

复制代码
$ tar -zxvf rust-1.68.2-x86_64-unknown-linux-gnu.tar.gz 
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
$ file rust-1.68.2-x86_64-unknown-linux-gnu.tar.gz 
rust-1.68.2-x86_64-unknown-linux-gnu.tar.gz: gzip compressed data, original size modulo 2^32 322181574 gzip compressed data, reserved method, has CRC, has comment, encrypted, from FAT filesystem (MS-DOS, OS/2, NT), original size modulo 2^32 322181574
我是用局域网文件传递命令从windows主机的本地复制的,可能传输中出现了问题,导致tar.gz类型有误,重新下载以下就行了

CG

相关推荐
孟健8 小时前
Karpathy 用 200 行纯 Python 从零实现 GPT:代码逐行解析
python
码路飞10 小时前
写了个 AI 聊天页面,被 5 种流式格式折腾了一整天 😭
javascript·python
曲幽13 小时前
FastAPI压力测试实战:Locust模拟真实用户并发及优化建议
python·fastapi·web·locust·asyncio·test·uvicorn·workers
chlk12316 小时前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑16 小时前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件17 小时前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
敏编程17 小时前
一天一个Python库:jsonschema - JSON 数据验证利器
python
前端付豪17 小时前
LangChain记忆:通过Memory记住上次的对话细节
人工智能·python·langchain
databook17 小时前
ManimCE v0.20.1 发布:LaTeX 渲染修复与动画稳定性提升
python·动效
深紫色的三北六号1 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移