0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OCI-Oracle LinuxでRust開発環境を構築する

0
Last updated at Posted at 2026-10-15

前の記事

構築編

Rust導入前

1.Development Toolsの導入確認

1.1.事前確認

Development Toolsの導入確認コマンドの実行 dnf group listで確認。

インストールされていない

[opc@test-server ~]$ sudo dnf group list
Last metadata expiration check: 0:22:23 ago on Xxx 99 Xxx 2099 99:99:99 XX XXX.
Available Environment Groups:
   Server with GUI
   Server
   Minimal Install
   Workstation
   Custom Operating System
   Virtualization Host
Available Groups:
   Legacy UNIX Compatibility
   Console Internet Tools
   Container Management
   Development Tools
   .NET Development
   Graphical Administration Tools
   Headless Management
   Network Servers
   RPM Development Tools
   Scientific Support
   Security Tools
   Smart Card Support
   System Tools

Development Toolsは、Available Groups:にあるのでインストール可能
※インストールされていない

インストール済み

[opc@test-server ~]$ sudo dnf group list
Last metadata expiration check: 0:22:23 ago on Xxx 99 Xxx 2099 99:99:99 XX XXX.
Available Environment Groups:
   Server with GUI
   Server
   Minimal Install
   Workstation
   Custom Operating System
   Virtualization Host
Installed Groups:
   Development Tools
Available Groups:
   Legacy UNIX Compatibility
   Console Internet Tools
   Container Management
   .NET Development
   Graphical Administration Tools
   Headless Management
   Network Servers
   RPM Development Tools
   Scientific Support
   Security Tools
   Smart Card Support
   System Tools

Development Toolsは、Installed Groups:にあるのでインストール可能
※インストールされていない

1.2.Development Toolsのインストール

1.2.Development Toolsのインストール
[opc@test-server ~]$ sudo dnf group listinstall "Development Tools"
Last metadata expiration check: 0:22:23 ago on Xxx 99 Xxx 2099 99:99:99 XX XXX.
Dependencies resolved.
================================================================================
 Package                   Arch   Version               Repository         Size
================================================================================
Upgrading:
 ****                     ***
(中略)
Installing group/module packages:
 ****                     ***
(中略)
Installing dependencies:
 ****                     ***
(中略)
Installing weak dependencies:
 ****                     ***
(中略)
Installing Groups:
 Development Tools                                                             

Transaction Summary
================================================================================
Install  999 Packages
Upgrade    9 Packages

Total download size: 999 M
Is this ok [y/N]: 

インストールするなら、y

Downloading Packages:
(1/999): **** 
(中略)
--------------------------------------------------------------------------------
Total                                            99 MB/s | 999 MB     99:99     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
(中略)
Complete!
[opc@test-server ~]$

導入の確認

[opc@test-server ~]$ sudo dnf group list
Last metadata expiration check: 0:22:23 ago on Xxx 99 Xxx 2099 99:99:99 XX XXX.
Available Environment Groups:
   Server with GUI
   Server
   Minimal Install
   Workstation
   Custom Operating System
   Virtualization Host
Installed Groups:
   Development Tools
Available Groups:
   Legacy UNIX Compatibility
   Console Internet Tools
   Container Management
   .NET Development
   Graphical Administration Tools
   Headless Management
   Network Servers
   RPM Development Tools
   Scientific Support
   Security Tools
   Smart Card Support
   System Tools

2.Rustの導入

2.1.Rustの確認

Rustの確認コマンドの実行 rustcで確認。

インストールされていない

[opc@test-server ~]$ rustc --version
-bash: rustc: command not found

※インストールされていない

2.2.Rustのインストール

Rustのインストール

インストール

[opc@test-server ~]$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!
(中略)

Current installation options:


    default host tuple: 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

1)を選ぶ(カスタムしない)

info: profile set to default
info: default host tuple is x86_64-unknown-linux-gnu
info: syncing channel updates for stable-x86_64-unknown-linux-gnu
info: downloading 9 components
(中略)

Rust is installed now. Great!

(中略)
[opc@test-server ~]$

</details>

### 2.3.Rustのパスを通す
<details>
<summary>
Rust関連パスの設定
</summary>

#### パスを通す
```shell-session
[opc@test-server ~]$ source $HOME/.cargo/env
[opc@test-server ~]$

2.3.Rustのパス設定

Rust関連パスの設定

パスを通す

[opc@test-server ~]$ source $HOME/.cargo/env
[opc@test-server ~]$

2.4.Rustの動作確認

Rustの動作確認

パスを通す

[opc@test-server ~]$ rustc --version
rustc 9.99.9 (xxxxxxxxx 2099-99-99)
[opc@test-server ~]$ cargo --version
cargo 9.99.9 (xxxxxxxxx 2099-99-99)

2.5.Rustupの確認

rustupの確認

rustupの確認

[opc@test-server ~]$ rustup --version
rustup 9.99.9 (xxxxxxxxx 2099-99-99)
[opc@test-server ~]$

2.6.Rustの更新

rustの更新

rustの更新

[opc@test-server ~]$ rustup update

  stable-x86_64-unknown-linux-gnu unchanged - rustc 9.99.9 (xxxxxxxxx 2099-99-99)

info: checking for self-update (current version: 9.99.9)
info: cleaning up downloads & tmp directories
[opc@test-server ~]$

3.rust-analyzer導入

3.1.rust-analyzer導入

rust-analyzer導入

導入

[opc@test-server ~]$ ustup component add rust-analyzer rust-analysis rust-src
info: downloading 3 components
rust-analyzer downloading [#########      ]    9.05 MiB (12.47 MiB/s, ETA: 0s)  rust-analysis downloading [               ]         0 B (0 B/s, ETA: 0s)        warn: using single-threaded unpacking due to low memory (ram budget: 298.9 MiB <rust-analyzer pending installation             9.05 MiB                         rust-analysis installed                       15.91 KiB                              rust-src downloading [#########      ]    5.59 MiB (2.29 MiB/s, ETA: 1s)   rust-analyzer unpacking   [##             ]    9.05 MiB (3.47 MiB/s, ETA: 2s)   rust-analysis installed                       15.91 KiB                              rust-src pending installation             5.59 MiB                         rust-analyzer installed                        9.05 MiB                         rust-analysis installed                       15.91 KiB                              rust-src installed                        5.59 MiB

最後に

記事の内容はCC BY-SA 4.0(著作者の情報とCCライセンス継承はお願いします。商用利用・改変・再配布は問題なし)です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?