visit
Oracle Cloud Infrastructure is a next-generation enterprise-class
Cloud Provider. Oracle Cloud provides both new infrastructure and a full set of platform capabilities. Oracle Cloud is expanding its presence in more than 36 regional locations across the globe.
OCI and its resources can be accessed through multiple
methods like Cloud Console or Command Line Interface (CLI). OCI CLI provides the same functionalities as Cloud console with additional parameters and it also helps to execute scripts. CLI is built on OCI SDK for Python and runs on Mac, Windows or Linux.
Pre-requisite
Type Windows Logo Key + R and type Winver and select OK
Installation
Run Powershell as Administratorwsl --install
wsl --list --online
wsl --install -d <distros_name>
Once installation of Linux Distros is done, it will prompt for User. You
will need to create a user account and password for your newly installed Linux distribution.
Commonly Used WSL Commands
Listing of installed Linux distributions and check the version of WSL.
wsl -l -v
wsl -l -o
wsl --install -d <distros_name>
$ sudo apt update
$ sudo apt -y update
$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
$ wget //www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
$tar -xf Python-3.8.3.tgz
You need to perform tests and optimizations before installing Python. It
increases the performance of the execution of codes by 10-20 percent:
$ cd Python-3.8.3
$ ./configure --enable-optimizations
Creating Virtual Environment for Python workspace
Creating a new folder for workspace (as Virtual Environment)$ mkdir -p ~/OCI/python && cd ~/OCI/python
$ python3.8 -m venv oracle-cli
After venv in place, it need to be activited. It is a crucial step.
$ source oracle-cli/bin/activate
Download the Vanila release not the distribution specific one e.g. oci-cli-release.zip
$ curl -L "//github.com/oracle/oci-cli/releases/download/v3.0.2/oci-cli-3.0.2.zip" -o /tmp/oci-cli-3.0.2.zip
bash -c "$(curl -L //raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
===> Enter a path to an rc file to update (file will be created if it does not exist) (leave blank to use '/home/skdan/.bashrc'):
-- Backed up '/home/skdan/.bashrc' to '/home/skdan/.bashrc.backup'
-- Tab completion set up complete.
-- If tab completion is not activated, verify that '/home/skdan/.bashrc' is sourced by your shell.
--
-- ** Run `exec -l $SHELL` to restart your shell. **
--
-- Installation successful.
-- Run the CLI with /home/skdan/bin/oci –help
$/home/skdan/bin/oci -v