Ubuntu – sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

environment-variablesoraclesoftware installation

  • echo $PATH gives me below result :


  • echo $ORACLE_HOME fetches :


  • echo LD_LIBRARY_PATH gives (set through /etc/bash.bashrc earlier, but now its showing as below)


doing vim for .bash_profile shows below things set :

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" #
Load RVM into a shell session *as a function*

    export LD_LIBRARY_PATH

    export PATH

Despite setting the ld_library_path in above file I'm still not getting the correct path in env despite running sudo ldconfig and then rebooting my machine!!

what help I'm looking for :

  • set env vars correctly

  • run sqlplus

Same question exists superuser, but no solution is given there.

Best Answer

As seen in the comments your Library is located at /usr/lib/oracle/12.1/client/lib/, but your path just includes /usr/lib/oracle/12.1/client/bin... you see why it can't find the library?

You can expand your LD_LIBRARY_PATH with the /usr/lib/oracle/12.1/client/lib/ directory (in your .profile or .environment or .bash_profile or (if you want it for all users) in the /etc/bash.bashrc file) - i don't know if sqlplus takes care of the LD_LIBRARY_PATH - just have a try.

To see to what LD_LIBRARY_PATH is set you have to type:


(note the $ if you want to read the value!)

Hope this helps!