当前位置: 首页 > article >正文

CentOS系统安装rustup

1、下载安装脚本并安装

[root@localhost nearcore]# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /root/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  /root/.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  /root/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /root/.profile
  /root/.bash_profile
  /root/.bashrc

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>

info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2024-11-28, rust version 1.83.0 (90b35a623 2024-11-26)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
 26.1 MiB /  26.1 MiB (100 %)  19.7 MiB/s in  1s ETA:  0s
info: downloading component 'rustc'
 69.3 MiB /  69.3 MiB (100 %)  50.2 MiB/s in  1s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
  8.6 MiB /   8.6 MiB (100 %)   7.6 MiB/s in  1s ETA:  0s
info: installing component 'clippy'
info: installing component 'rust-docs'
 16.4 MiB /  16.4 MiB (100 %)   2.4 MiB/s in 10s ETA:  0s
info: installing component 'rust-std'
 26.1 MiB /  26.1 MiB (100 %)   8.8 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 69.3 MiB /  69.3 MiB (100 %)  11.2 MiB/s in  6s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu installed - rustc 1.83.0 (90b35a623 2024-11-26)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env"            # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish"  # For fish
2、加入环境变量
```bash
[root@localhost nearcore]# source $HOME/.cargo/env

3、查询安装版本

[root@localhost nearcore]# rustc --version
info: syncing channel updates for '1.82.0-x86_64-unknown-linux-gnu'
info: latest update on 2024-10-17, rust version 1.82.0 (f6e511eec 2024-10-15)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-analyzer'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-analyzer'
info: installing component 'rust-docs'
info: installing component 'rust-src'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
rustc 1.82.0 (f6e511eec 2024-10-15)
[root@localhost nearcore]# cargo --version
cargo 1.82.0 (8f40fc59f 2024-08-21)

http://www.kler.cn/a/443552.html

相关文章:

  • 计算机网络 (13)信道复用技术
  • 【AI大模型】探索GPT模型的奥秘:引领自然语言处理的新纪元
  • 图像处理-Ch7-快速小波变换和小波包
  • ubuntu22装机的一些问题及解决方法
  • Type-C接口的拍摄云台
  • Wordly Wise 3000 国际背单词01 介绍 + 测词汇量
  • EPMA技术:高效率分析仪器的原理与应用-测试狗
  • 贝叶斯推断的条件观点
  • Redis 附加功能(三)— 持久化、发布与订阅及模块
  • 计算机基础知识——数据结构与算法(二)(山东省大数据职称考试)
  • Linux服务器上安装JDK1.8
  • ilqr算法原理推导及代码实践
  • 音视频入门基础:MPEG2-TS专题(19)——FFmpeg源码中,解析TS流中的PES流的实现
  • [网络]tcp通信协议接口函数及一些简易项目
  • 【后端面试总结】深入解析进程和线程的区别
  • 《C++ 赋能强化学习:Q - learning 算法的实现之路》
  • 【Java 数据结构】如何写一副扑克牌 (附:全部码源) !!!
  • 量子通信学习路径(一)
  • JS使用random随机数实现简单的四则算数验证
  • transformer学习笔记-位置编码
  • 使用 NVIDIA DALI 计算视频的光流
  • 【设计模式】单例模式的应用场景
  • 计算机的错误计算(一百八十五)
  • AI-PR曲线
  • C++中如何实现单例模式?
  • 【Maven】基础(一)