1
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】UbuntuでOCI CLIをインストールする

Last updated at Posted at 2025-10-13

Oracle Cloud Infrastructure(OCI)をCLI(Command Line Interface)から操作するための「OCI CLI」を、Ubuntu環境にインストールする手順をまとめました。

概要

本記事では以下の流れで進めます。

  1. Pythonの確認
  2. OCI CLIのインストール
  3. PATH設定の反映
  4. 動作確認

1. Pythonの確認

OCI CLIはPythonで動作します。
まずはPythonがインストールされているか確認します。

python3 --version

もし入っていない場合は以下でインストールします:

sudo apt update
sudo apt install python3 python3-pip -y

2. OCI CLIのインストール

Oracle公式のインストールスクリプトを使用します。

bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

実行中にいくつか質問が出ます。

In what directory would you like to place the install?
→ /home/ubuntu/lib/oracle-cli (デフォルトでOK)

In what directory would you like to place the 'oci' executable?
→ /home/ubuntu/bin (デフォルトでOK)

What optional CLI packages would you like to be installed?
→ (空EnterでスキップOK)

Modify profile to update your PATH and enable shell/tab completion now? (Y/n):
→ Y(推奨)

Enter a path to an rc file to update (file will be created if it does not exist):
→ /home/ubuntu/.bashrc (デフォルトでOK)

インストール完了後に設定を反映します。

source ~/.bashrc

(Zshの場合は source ~/.zshrc)

もしくは、新しいログインシェルを起動します。

exec -l $SHELL

3. 動作確認

次のコマンドでバージョンが表示されれば成功です。

oci --version

出力例:

3.68.0
1
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
1
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?