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

Health Check Script

Oracle Database Health Check Script Run this script has sysdba user or any user having DBA Role Change the spool file patch to correct directory. In this example it is set to  /export/home/oraprod/ $ cat Health_Check_Script.sql set pagesize 1100 SET MARKUP HTML ON SPOOL ON spool /export/home/oraprod/health_check_new.html set feedback off set linesize 200; set pages 50 set lines 1000 set pages 70 set heading on PROMPT================================================================ prompt PROMPT PROMPT Daily_Monitoring Checkup Report prompt ================================================================================================================================================= PROMPT REPORT DATE select to_char(sysdate,'DD-MON-YYYY:HH:MI:SS') "Report Run Date" from dual; prompt DATABASE NAME PROMPT ============== select instance_name,host_name,version,status from gv$instance ,v$database a; PROMPT DATABASE INFO PROMPT =============...

12.1.0 Grid Installation on Solaris 11.3 fails with ASM failed to start

Issue Description  We faced one issue, while installing the GI 12.1.0.1.0 on Solaris 11.3  ASM failed to start. Check /u01/app/grid/cfgtoollogs/asmca/asmca-201202PM061908.log for details. 2020/12/02 18:19:17 CLSRSC-184: Configuration of ASM failed 2020/12/02 18:19:17 CLSRSC-258: Failed to configure and start ASM Died at /u01/app/12.1.0/grid_1/crs/install/crsinstall.pm line 1976. The command '/u01/app/12.1.0/grid_1/perl/bin/perl -I/u01/app/12.1.0/grid_1/perl/lib -I/u01/app/12.1.0/grid_1/crs/install /u01/app/12.1.0/grid_1/crs/install/rootcrs.pl ' execution failed This error is coming during root.sh execution on primary node. After checking the asmca logs, the error seen is as below: ========================== [main] [ 2020-12-02 17:00:49.575 AST ] [UsmcaLogger.logException:156] SEVERE:method oracle.sysman.assistants.usmca.backend.USMInstance:configureLocalASM [main] [ 2020-12-02 17:00:49.575 AST ] [UsmcaLogger.logException:157] ORA-27122: unable to protect memory [main] [ 2020-1...

12.2 Stage area creation fails with startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory

 12.2 Stage area creation fails with startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory While creating the stage area for 12.2 Installation, we face issue while running the buildstage.sh ....startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory Solution:  Please go to the path provided in the error log and check if the java is working fine with below command: java -version Generally this java is having some issues.   Install the jre 7 or jre 8 and copy the the jre at the same path by renaming old folder. It should work fine.  Now if your run the build command again, it should succeed.  Running command: /u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java -classpath /u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/emocmutl.jar:/u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/ewt-3_4_22.jar:/u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/share-1_1_18.jar:/u01/soft/ebs/star...