Debian 11.2にRustをインストールしてHello Worldを出力する

# cat /etc/debian_version


# curl --proto '=https' --tlsv1.2 -sSf | 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:


This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory located at:


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:


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


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 installation (default)
2) Customize installation
3) Cancel installation
>  #ENTERを入力するとdefaultがインストールされます
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, run:
source $HOME/.cargo/env


# exec $SHELL -l


# cargo --version
cargo 1.59.0 (49d8809dc 2022-02-10)


# rustc -V
rustc 1.59.0 (9d1b2106e 2022-02-23)


# rustup -V
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.59.0 (9d1b2106e 2022-02-23)`


# cargo new rust-cft
Created binary (application) `rust-cft` package

# cd rust-cft
# cargo run

Compiling rust-cft v0.1.0 (/root/rust-cft)
Finished dev [unoptimized + debuginfo] target(s) in 1.66s
Running `target/debug/rust-cft`
Hello, world!



Posted by arkgame