Skip to main content

How to Install OCI CLI on Linux

How to Install OCI CLI on Linux

To install the OCL CLI on Linux

  1. Open a terminal.
  2. To run the installer script, run the following command.
[root@dev02 ~]# bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14867  100 14867    0     0   8588      0  0:00:01  0:00:01 --:--:--  8583

    ******************************************************************************
    You have started the OCI CLI Installer in interactive mode. If you do not wish
    to run this in interactive mode, please include the --accept-all-defaults option.
    If you have the script locally and would like to know more about
    input options for this script, then you can run:
    ./install.sh -h
    If you would like to know more about input options for this script, refer to:
    https://github.com/oracle/oci-cli/blob/master/scripts/install/README.rst
    ******************************************************************************
Downloading Oracle Cloud Infrastructure CLI install script from https://raw.githubusercontent.com/oracle/oci-cli/v2.9.3/scripts/install/install.py to /tmp/oci_cli_install_tmp_XGiv.
########################################################################################################################################################################################### 100.0%
Python not found on system PATH
Running install script.
python3 /tmp/oci_cli_install_tmp_XGiv
-- Verifying Python version.
-- Python version 3.6.8 okay.

===> In what directory would you like to place the install? (leave blank to use '/root/lib/oracle-cli'):
-- Creating directory '/root/lib/oracle-cli'.
-- We will install at '/root/lib/oracle-cli'.

===> In what directory would you like to place the 'oci' executable? (leave blank to use '/root/bin'):
-- Creating directory '/root/bin'.
-- The executable will be in '/root/bin'.

===> In what directory would you like to place the OCI scripts? (leave blank to use '/root/bin/oci-cli-scripts'):
-- Creating directory '/root/bin/oci-cli-scripts'.
-- The scripts will be in '/root/bin/oci-cli-scripts'.

===> Currently supported optional packages are: ['db (will install cx_Oracle)']
What optional CLI packages would you like to be installed (comma separated names; press enter if you don't need any optional packages)?: db
-- The optional packages installed will be 'db'.
-- Trying to use python3 venv.
-- Executing: ['/usr/bin/python3', '-m', 'venv', '/root/lib/oracle-cli']
-- Executing: ['/root/lib/oracle-cli/bin/pip', 'install', '--upgrade', 'pip']
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 198kB/s
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-20.1
-- Executing: ['/root/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpo8naa29h', 'wheel', '--upgrade']
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Installing collected packages: wheel
Successfully installed wheel-0.34.2
-- Executing: ['/root/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpo8naa29h', 'oci_cli[db]', '--upgrade']
Collecting oci_cli[db]
  Downloading oci_cli-2.10.1-py2.py3-none-any.whl (8.2 MB)
     |████████████████████████████████| 8.2 MB 44 kB/s
Collecting retrying==1.3.3
  Downloading retrying-1.3.3.tar.gz (10 kB)
Collecting pyOpenSSL==18.0.0
  Downloading pyOpenSSL-18.0.0-py2.py3-none-any.whl (53 kB)
     |████████████████████████████████| 53 kB 186 kB/s
Collecting terminaltables==3.1.0
  Downloading terminaltables-3.1.0.tar.gz (12 kB)
Collecting python-dateutil<3.0.0,>=2.5.3
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
     |████████████████████████████████| 227 kB 98 kB/s
Collecting jmespath==0.9.4
  Downloading jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting certifi
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 117 kB/s
Collecting PyYAML==5.1.2
  Downloading PyYAML-5.1.2.tar.gz (265 kB)
     |████████████████████████████████| 265 kB 190 kB/s
Collecting arrow==0.14.7
  Downloading arrow-0.14.7-py2.py3-none-any.whl (39 kB)
Collecting cryptography==2.8
  Downloading cryptography-2.8-cp34-abi3-manylinux2010_x86_64.whl (2.3 MB)
     |████████████████████████████████| 2.3 MB 118 kB/s
Collecting idna<2.7,>=2.5
  Downloading idna-2.6-py2.py3-none-any.whl (56 kB)
     |████████████████████████████████| 56 kB 91 kB/s
Collecting configparser==4.0.2
  Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
Collecting oci==2.14.0
  Downloading oci-2.14.0-py2.py3-none-any.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 300 kB/s
Collecting click==6.7
  Downloading click-6.7-py2.py3-none-any.whl (71 kB)
     |████████████████████████████████| 71 kB 62 kB/s
Collecting six==1.14.0
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting pytz>=2016.10
  Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 429 kB/s
Collecting cx-Oracle==7.0; extra == "db"
  Downloading cx_Oracle-7.0.0-cp36-cp36m-manylinux1_x86_64.whl (675 kB)
     |████████████████████████████████| 675 kB 422 kB/s
Collecting cffi!=1.11.3,>=1.8
  Downloading cffi-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (399 kB)
     |████████████████████████████████| 399 kB 69 kB/s
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 536 kB/s
Building wheels for collected packages: retrying, terminaltables, PyYAML
  Building wheel for retrying (setup.py) ... done
  Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=11430 sha256=08791050cbdbf315306c58daba16697b4b2e4af65e773fb178d72931707ea6d9
  Stored in directory: /tmp/tmpo8naa29h/wheels/ac/cb/8a/b27bf6323e2f4c462dcbf77d70b7c5e7868a7fbe12871770cf
  Building wheel for terminaltables (setup.py) ... done
  Created wheel for terminaltables: filename=terminaltables-3.1.0-py3-none-any.whl size=15354 sha256=a725115503c88152be08c0a5e8066e777ac8b23f15e3e730c6cbc2ff98ca6c4b
  Stored in directory: /tmp/tmpo8naa29h/wheels/86/1b/58/c23af2fe683acd8edc15d5a1268f0242be1ff2cf827fe34737
  Building wheel for PyYAML (setup.py) ... done
  Created wheel for PyYAML: filename=PyYAML-5.1.2-cp36-cp36m-linux_x86_64.whl size=44104 sha256=dd749f808cb88be452034330e4e75b3e053661a73726b6f441ddc636e5703319
  Stored in directory: /tmp/tmpo8naa29h/wheels/d8/9b/e7/75af463b873c119dd444151fc54a8e190c87993593e1fa194a
Successfully built retrying terminaltables PyYAML
Installing collected packages: six, retrying, pycparser, cffi, cryptography, pyOpenSSL, terminaltables, python-dateutil, jmespath, certifi, PyYAML, arrow, idna, configparser, pytz, oci, click, cx-Oracle, oci-cli
Successfully installed PyYAML-5.1.2 arrow-0.14.7 certifi-2020.4.5.1 cffi-1.14.0 click-6.7 configparser-4.0.2 cryptography-2.8 cx-Oracle-7.0.0 idna-2.6 jmespath-0.9.4 oci-2.14.0 oci-cli-2.10.1 pyOpenSSL-18.0.0 pycparser-2.20 python-dateutil-2.8.1 pytz-2020.1 retrying-1.3.3 six-1.14.0 terminaltables-3.1.0

===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): y

===> Enter a path to an rc file to update (leave blank to use '/root/.bashrc'):
-- Backed up '/root/.bashrc' to '/root/.bashrc.backup'
-- Tab completion set up complete.
-- If tab completion is not activated, verify that '/root/.bashrc' is sourced by your shell.
--
-- ** Run `exec -l $SHELL` to restart your shell. **
--
-- Installation successful.
-- Run the CLI with /root/bin/oci --help
[root@dev02 ~]#


[root@dev02 ~]# oci -v
2.10.1
[root@dev02 ~]#
It shows the OCI version as 2.10.1 

This completes the OCI CLI installation on Linux

Comments

Popular posts from this blog

Warning Message When Creating A Keystore

  Warning Message When Creating A Keystore When we try to list the contents of the keystore, using the below command, keytool -list -v -keystore adkeystore.dat Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: prod_apps002 Creation date: Jan 26, 2012 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate[1]: Owner: CN=PROD_apps002, OU=apps, O=apps002, C=US Issuer: CN=PROD_apps002, OU=apps, O=apps002, C=US Serial number: 4f208085 Valid from: Thu Jan 26 01:21:57 AST 2012 until: Tue Jan 16 01:21:57 AST 2052 Certificate fingerprints:          MD5:  XX: XX XX XX          SHA1:  XX: XX XX XX          SHA256:  XX: XX XX XX Signature algorithm name: SHA1withDSA Subject Public Key Algorithm: 1024-bit DSA key Version: 3 ******************************************* ******************************************* Warning: The JKS keystore...

CLEARING an ADOP patching session

In some case adop prepare phase fails due to some issues and if you wish to apply any patch in hotpatch mode, it will fail with below errors [STATEMENT] There is already a session which is incomplete. Details are: [STATEMENT]     Session Id: 2 [STATEMENT]     Prepare phase status: R [STATEMENT]     Apply phase status: N [STATEMENT]     Cutover  phase status: N [STATEMENT]     Abort phase status: N [STATEMENT]     Session status: F [ERROR]     Cannot apply hotpatch as another online patching cycle is going on [ERROR]     Unrecoverable error occured. Exiting the current session. [STATEMENT] [START 2019/10/22 16:13:00] Unlocking sessions table [STATEMENT] [END   2019/10/22 16:13:00] Unlocking sessions table [STATEMENT] Log file: /adop_20191022_161221.log [STATEMENT] [START 2019/10/22 16:13:02] Unlocking sessions table [STATEMENT] [E...

XX_XXXXXXX is not a valid responsibility for the current user. Please contact your System Administrator.

  XX_XXXXXXX is not a valid responsibility for the current user. Please contact your System Administrator. Issue : When user logs into EBS, he gets the following Error :  xx_XXXXX  is not a valid responsibility for the current user. Please contact your System Administrator. Solution: 1. Check if the responsibility is end dated.  Extend the end-date if required and try to login again.  2. Check the profile option  Applications Start Page for the user ( User Level). If there is any value defined, remove it and save it. Try to login again and it worked in our case.  Before: After: