Ubuntu 21.10にプログラム言語Rustをインストール
OSバージョンを確認
# cat /etc/issue
Ubuntu 21.10 \n \l
1.gccをインストール
# sudo apt install -y gcc
2.Rustをインストール
# curl https://sh.rustup.rs -sSf | sh
略 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 > 1 略 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
3.PATHを通す
# source $HOME/.cargo/env
rustバージョンを確認
# rustc –version
rustc 1.56.0 (09c42c458 2021-10-18)
4.動作確認
# vi test.rs
# vi test.rs fn main() { println!("study rust skill"); }
実行
# rustc test.rs
# ./test
study rust skill