TheKoguryo's Tech Blog

 Version 2024.04.01

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

14.1.1.2 Installing OCI CLI on Linux

  1. Run Terminal

  2. Run the following to run the installation script

    bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
    
    • Python installed: Y response
      • After checking the installation path, set
      • Y response when checking for new version update of CLI
      • Y response when requesting to add CLI to PATH
    1. Installation example
    oracle@ubuntu:~$ 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  6226  100  6226    0     0   8910      0 --:--:-- --:--:-- --:--:--  8919
    Downloading Oracle Cloud Infrastructure CLI install script from https://raw.githubusercontent.com/oracle/oci-cli/6dc61e3b5fd2781c5afff2decb532c24969fa6bf/scripts/install/install.py to /tmp/oci_cli_install_tmp_vLIJ.
    ######################################################################## 100.0%
    Running install script.
    -- Verifying Python version.
    -- Python version 3.5.2 okay.
    -- Verifying native dependencies.
    -- Executing: 'dpkg -s libssl-dev libffi-dev python3-dev build-essential'
    -- One or more of the following native dependencies are not currently installed and may be required.
    "sudo apt-get install -y libssl-dev libffi-dev python3-dev build-essential"
    
    ===> Missing native dependencies. Continue and install the following dependencies: libssl-dev, libffi-dev, python3-dev, build-essential? (Y/n): Y
    [sudo] password for oracle:
    Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
    Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
    Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
    Hit:4 https://download.docker.com/linux/ubuntu xenial InRelease
    Hit:5 http://security.ubuntu.com/ubuntu xenial-security InRelease
    Hit:6 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
    Reading package lists... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    build-essential is already the newest version (12.1ubuntu2).
    libssl-dev is already the newest version (1.0.2g-1ubuntu4.14).
    libssl-dev set to manually installed.
    The following packages were automatically installed and are no longer required:
      linux-headers-4.13.0-36 linux-headers-4.13.0-36-generic linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic
      linux-headers-4.13.0-45 linux-headers-4.13.0-45-generic linux-image-4.13.0-36-generic
      linux-image-4.13.0-43-generic linux-image-4.13.0-45-generic linux-image-extra-4.13.0-36-generic
      linux-image-extra-4.13.0-43-generic linux-image-extra-4.13.0-45-generic
    Use 'sudo apt autoremove' to remove them.
    The following additional packages will be installed:
      libexpat1-dev libpython3-dev libpython3.5-dev python3.5-dev
    The following NEW packages will be installed:
      libexpat1-dev libffi-dev libpython3-dev libpython3.5-dev python3-dev python3.5-dev
    0 upgraded, 6 newly installed, 0 to remove and 204 not upgraded.
    Need to get 38.0 MB of archives.
    After this operation, 55.3 MB of additional disk space will be used.
    Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libexpat1-dev amd64 2.1.0-7ubuntu0.16.04.3 [115 kB]
    Get:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpython3.5-dev amd64 3.5.2-2ubuntu0~16.04.5 [37.3 MB]
    Get:3 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 libpython3-dev amd64 3.5.1-3 [6,926 B]
    Get:4 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python3.5-dev amd64 3.5.2-2ubuntu0~16.04.5 [413 kB]
    Get:5 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 python3-dev amd64 3.5.1-3 [1,186 B]
    Get:6 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 libffi-dev amd64 3.2.1-4 [161 kB]
    Fetched 38.0 MB in 4s (8,676 kB/s)
    Selecting previously unselected package libexpat1-dev:amd64.
    (Reading database ... 322016 files and directories currently installed.)
    Preparing to unpack .../libexpat1-dev_2.1.0-7ubuntu0.16.04.3_amd64.deb ...
    Unpacking libexpat1-dev:amd64 (2.1.0-7ubuntu0.16.04.3) ...
    Selecting previously unselected package libpython3.5-dev:amd64.
    Preparing to unpack .../libpython3.5-dev_3.5.2-2ubuntu0~16.04.5_amd64.deb ...
    Unpacking libpython3.5-dev:amd64 (3.5.2-2ubuntu0~16.04.5) ...
    Selecting previously unselected package libpython3-dev:amd64.
    Preparing to unpack .../libpython3-dev_3.5.1-3_amd64.deb ...
    Unpacking libpython3-dev:amd64 (3.5.1-3) ...
    Selecting previously unselected package python3.5-dev.
    Preparing to unpack .../python3.5-dev_3.5.2-2ubuntu0~16.04.5_amd64.deb ...
    Unpacking python3.5-dev (3.5.2-2ubuntu0~16.04.5) ...
    Selecting previously unselected package python3-dev.
    Preparing to unpack .../python3-dev_3.5.1-3_amd64.deb ...
    Unpacking python3-dev (3.5.1-3) ...
    Selecting previously unselected package libffi-dev:amd64.
    Preparing to unpack .../libffi-dev_3.2.1-4_amd64.deb ...
    Unpacking libffi-dev:amd64 (3.2.1-4) ...
    Processing triggers for doc-base (0.10.7) ...
    Processing 2 added doc-base files...
    Processing triggers for man-db (2.7.5-1) ...
    Processing triggers for install-info (6.1.0.dfsg.1-5) ...
    Setting up libexpat1-dev:amd64 (2.1.0-7ubuntu0.16.04.3) ...
    Setting up libpython3.5-dev:amd64 (3.5.2-2ubuntu0~16.04.5) ...
    Setting up libpython3-dev:amd64 (3.5.1-3) ...
    Setting up python3.5-dev (3.5.2-2ubuntu0~16.04.5) ...
    Setting up python3-dev (3.5.1-3) ...
    Setting up libffi-dev:amd64 (3.2.1-4) ...
    
    ===> In what directory would you like to place the install? (leave blank to use '/home/oracle/lib/oracle-cli'):
    -- Creating directory '/home/oracle/lib/oracle-cli'.
    -- We will install at '/home/oracle/lib/oracle-cli'.
    
    ===> In what directory would you like to place the 'oci' executable? (leave blank to use '/home/oracle/bin'):
    -- Creating directory '/home/oracle/bin'.
    -- The executable will be in '/home/oracle/bin'.
    
    ===> In what directory would you like to place the OCI scripts? (leave blank to use '/home/oracle/bin/oci-cli-scripts'):
    -- Creating directory '/home/oracle/bin/oci-cli-scripts'.
    -- The scripts will be in '/home/oracle/bin/oci-cli-scripts'.
    -- Downloading virtualenv package from https://github.com/pypa/virtualenv/archive/15.0.0.tar.gz.
    -- Downloaded virtualenv package to /tmp/tmpw9mlqtyq/15.0.0.tar.gz.
    -- Checksum of /tmp/tmpw9mlqtyq/15.0.0.tar.gz OK.
    -- Extracting '/tmp/tmpw9mlqtyq/15.0.0.tar.gz' to '/tmp/tmpw9mlqtyq'.
    -- Executing: ['/usr/bin/python3', 'virtualenv.py', '--python', '/usr/bin/python3', '/home/oracle/lib/oracle-cli']
    Already using interpreter /usr/bin/python3
    Using base prefix '/usr'
    New python executable in /home/oracle/lib/oracle-cli/bin/python3
    Also creating executable in /home/oracle/lib/oracle-cli/bin/python
    Installing setuptools, pip, wheel...done.
    -- Executing: ['/home/oracle/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpw9mlqtyq', 'oci_cli', '--upgrade']
    Collecting oci_cli
      Downloading https://files.pythonhosted.org/packages/b0/05/edb582a14ad96757601e98f27ebf1a825c918bf745f197d177af2d6423a7/oci_cli-2.4.40-py2.py3-none-any.whl (2.3MB)
        100% |████████████████████████████████| 2.3MB 2.7MB/s
    Collecting pytz==2016.10 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/f5/fa/4a9aefc206aa49a4b5e0a72f013df1f471b4714cdbe6d78f0134feeeecdb/pytz-2016.10-py2.py3-none-any.whl (483kB)
        100% |████████████████████████████████| 491kB 11.3MB/s
    Collecting six==1.11.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
    Collecting certifi (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
        100% |████████████████████████████████| 163kB 14.7MB/s
    Collecting retrying==1.3.3 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/44/ef/beae4b4ef80902f22e3af073397f079c96969c69b2c7d52a57ea9ae61c9d/retrying-1.3.3.tar.gz
    Collecting httpsig-cffi==15.0.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/93/f5/c9a213c0f906654c933f1192148d8aded2022678ad6bce8803d3300501c6/httpsig_cffi-15.0.0-py2.py3-none-any.whl
    Collecting arrow==0.10.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/54/db/76459c4dd3561bbe682619a5c576ff30c42e37c2e01900ed30a501957150/arrow-0.10.0.tar.gz (86kB)
        100% |████████████████████████████████| 92kB 14.3MB/s
    Collecting jmespath==0.9.3 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
    Collecting idna<2.7,>=2.5 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl (56kB)
        100% |████████████████████████████████| 61kB 3.1MB/s
    Collecting python-dateutil==2.7.3 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
        100% |████████████████████████████████| 215kB 16.8MB/s
    Collecting pyOpenSSL==17.5.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/79/db/7c0cfe4aa8341a5fab4638952520d8db6ab85ff84505e12c00ea311c3516/pyOpenSSL-17.5.0-py2.py3-none-any.whl (53kB)
        100% |████████████████████████████████| 61kB 11.9MB/s
    Collecting cryptography==2.1.4 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/15/4e/c0a0641dc0b4bba7c1dfcf66e30ef34effe7f7dc20a37459e9e052afc4cf/cryptography-2.1.4-cp35-cp35m-manylinux1_x86_64.whl (2.2MB)
        100% |████████████████████████████████| 2.2MB 10.3MB/s
    Collecting terminaltables==3.1.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bff/terminaltables-3.1.0.tar.gz
    Collecting oci==2.1.3 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/1d/35/61606bc5c885c13bd1d742d76cf6e8eac6a2733b33d65bc41fd3b6c9ff1b/oci-2.1.3-py2.py3-none-any.whl (1.5MB)
        100% |████████████████████████████████| 1.5MB 11.7MB/s
    Collecting click==6.7 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
        100% |████████████████████████████████| 71kB 4.9MB/s
    Collecting configparser==3.5.0 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz
    Collecting cx-Oracle==6.2.1 (from oci_cli)
      Downloading https://files.pythonhosted.org/packages/10/1c/fbd4e3d6f043f6c934d4a2711f543e755a2b82cfae7c382488b68a2d9db5/cx_Oracle-6.2.1-cp35-cp35m-manylinux1_x86_64.whl (585kB)
        100% |████████████████████████████████| 593kB 16.0MB/s
    Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography==2.1.4->oci_cli)
      Downloading https://files.pythonhosted.org/packages/59/cc/0e1635b4951021ef35f5c92b32c865ae605fac2a19d724fb6ff99d745c81/cffi-1.11.5-cp35-cp35m-manylinux1_x86_64.whl (420kB)
        100% |████████████████████████████████| 430kB 13.7MB/s
    Collecting asn1crypto>=0.21.0 (from cryptography==2.1.4->oci_cli)
      Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
        100% |████████████████████████████████| 102kB 3.0MB/s
    Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography==2.1.4->oci_cli)
      Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
        100% |████████████████████████████████| 163kB 18.4MB/s
    Building wheels for collected packages: retrying, arrow, terminaltables, configparser, pycparser
      Running setup.py bdist_wheel for retrying ... done
      Stored in directory: /tmp/tmpw9mlqtyq/wheels/d7/a9/33/acc7b709e2a35caa7d4cae442f6fe6fbf2c43f80823d46460c
      Running setup.py bdist_wheel for arrow ... done
      Stored in directory: /tmp/tmpw9mlqtyq/wheels/ce/4f/95/64541c7466fd88ffe72fda5164f8323c91d695c9a77072c574
      Running setup.py bdist_wheel for terminaltables ... done
      Stored in directory: /tmp/tmpw9mlqtyq/wheels/30/6b/50/6c75775b681fb36cdfac7f19799888ef9d8813aff9e379663e
      Running setup.py bdist_wheel for configparser ... done
      Stored in directory: /tmp/tmpw9mlqtyq/wheels/a3/61/79/424ef897a2f3b14684a7de5d89e8600b460b89663e6ce9d17c
      Running setup.py bdist_wheel for pycparser ... done
      Stored in directory: /tmp/tmpw9mlqtyq/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
    Successfully built retrying arrow terminaltables configparser pycparser
    Installing collected packages: pytz, six, certifi, retrying, idna, pycparser, cffi, asn1crypto, cryptography, httpsig-cffi, python-dateutil, arrow, jmespath, pyOpenSSL, terminaltables, configparser, oci, click, cx-Oracle, oci-cli
    Successfully installed arrow-0.10.0 asn1crypto-0.24.0 certifi-2018.11.29 cffi-1.11.5 click-6.7 configparser-3.5.0 cryptography-2.1.4 cx-Oracle-6.2.1 httpsig-cffi-15.0.0 idna-2.6 jmespath-0.9.3 oci-2.1.3 oci-cli-2.4.40 pyOpenSSL-17.5.0 pycparser-2.19 python-dateutil-2.7.3 pytz-2016.10 retrying-1.3.3 six-1.11.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 '/home/oracle/.bashrc'):
    -- Backed up '/home/oracle/.bashrc' to '/home/oracle/.bashrc.backup'
    -- Tab completion set up complete.
    -- If tab completion is not activated, verify that '/home/oracle/.bashrc' is sourced by your shell.
    --
    -- ** Run `exec -l $SHELL` to restart your shell. **
    --
    -- Installation successful.
    -- Run the CLI with /home/oracle/bin/oci --help
    oracle@ubuntu:~$
    


As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 7 Jan 2019