Rocky Linux 9にプログラム言語Rustをインストールする
環境
OSバージョンを確認します
# cat /etc/redhat-release
Rocky Linux release 9.0 (Blue Onyx)
操作方法
1.システムパッケージを更新します
# sudo dnf upgrade --refresh
2.EPEL/EPELリポジトリをインストールします
CRBリポジトリを有効にします
# sudo dnf config-manager --set-enabled crb
dnfでEPELリポジトリをインストールします
# sudo dnf install \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
3.依存関係パッケージをインストールします
# sudo dnf install cmake gcc make curl -y
4.Rustプログラム言語をインストールします
# 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 installation (default) 2) Customize installation 3) Cancel installation >1 #1を入力します 略 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"
5.環境を反映します
# source ~/.profile # source ~/.cargo/env
6.バージョンを確認します
# rustc -V rustc 1.64.0 (a55dd71d5 2022-09-19)