Reference: https://help.ubuntu.com/community/Oracle%20Instant%20Client
Note
This was last updated for Ubuntu 24.04
-
Decide which version of the Oracle client to install
- Each version of the client supports certain versions of the database; for example, Oracle client 21 supports Oracle database 12.1 - 26
- See here for more information: http://support.oracle.com/epmos/faces/DocumentDisplay?id=207303.1
-
Download the Oracle client packages
- Go here and download the desired RPM package(s): https://www.oracle.com/database/technologies/instant-client/downloads.html
- At a minimum you'll need either the
basiclitepackage (for English error messages and Western language character sets) or thebasicpackage (to support all languages) - Get the
sqlpluspackage if you'd like to use thesqlpluscommand
-
Install prerequisites
sudo apt install alien libaio1t64For older versions of Ubuntu:
sudo apt install alien libaio1 -
Create symlink from
libaio.so.1tolibaio.so.1t64ⓘ This is only needed if you installed the
libaio1t64package; newer versions of Ubuntu don't havelibaio.so.1t64but the Oracle client looks forlibaio.so.1(source)sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 -
Install the Oracle client package(s)
sudo alien -i oracle-instantclient-basiclite-21.22.0.0.0-1.x86_64.rpm -
Make sure the libraries were installed system-wide, e.g.
$ ldconfig -p | grep libclntsh libclntshcore.so.21.1 (libc6,x86-64) => /usr/lib/oracle/21/client64/lib/libclntshcore.so.21.1 libclntshcore.so (libc6,x86-64) => /usr/lib/oracle/21/client64/lib/libclntshcore.so libclntsh.so.21.1 (libc6,x86-64) => /usr/lib/oracle/21/client64/lib/libclntsh.so.21.1 libclntsh.so (libc6,x86-64) => /usr/lib/oracle/21/client64/lib/libclntsh.so -
If the libraries aren't installed, you can update the system library path to include the oracle libraries
ⓘ This is only necessary if the previous command didn't return anything
sudo sh -c 'echo /usr/lib/oracle/21/client64/lib/ > /etc/ld.so.conf.d/oracle.conf' sudo ldconfig
if someone use version 21.6 the last step should be