If you are using drivers and libraries that need access to Oracle databases (e.g. perl-DBD-Oracle), you will need the Oracle Instantclient. Oracle offers this software for free after registration. Unfortunately creating correct provides tags was missed when creating the RPM packages. Even though Instantclient is installed, software like perl-DBD-Oracle cannot be installed – because of missing files:
# yum install perl-DBD-Oracle ... --> Finished Dependency Resolution Error: Package: perl-DBD-Oracle-1.74-1.el6.x86_64 Requires: libocci.so.11.1()(64bit) Error: Package: perl-DBD-Oracle-1.74-1.el6.x86_64 Requires: libclntsh.so.11.1()(64bit) You could try using --skip-broken to work around the problem
However, the files exist on the file system:
# rpm -ql oracle-instantclient11.2-basic|egrep "clntsh|occi" /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 /usr/lib/oracle/11.2/client64/lib/libocci.so.11.1
Using the following rpm command it is possible to display which files are “provided” by a particular package:
$ rpm -qp --provides oracle-instantclient11.2-basic-126.96.36.199.0-1.x86_64.rpm oracle-instantclient11.2-basic = 188.8.131.52.0-1
Here are various missing entries including the libraries mentioned above. The perl-DBD-Oracle RPM package requires these files:
$ rpm -qp --requires perl-DBD-Oracle-1.74-1.el6.x86_64.rpm ... libclntsh.so.11.1()(64bit) libocci.so.11.1()(64bit) ...
YUM is unable to find an installed or installable RPM package that offers these files and stops with an dependency problem.
Of course it is possible to ignore these dependency problems by “forcing” rpm to install the package – anyhow this is not a nice solution and also generates warnings inside YUM.
A possible workaround is to create a RPM package that pretends to provide the requires libraries – but is not providing any file at all. It is advisable to create a dependency to the Oracle Instantclient package to install the libraries. YUM will act like this:
- YUM searches a package that provides libclntsh and libocci
- YUM finds the dummy package and marks it for installation
- The dummy package has a dependency to the Instantclient package – so this package is also marked for installation
For creating the dummy package, RPM development tools need to be installed. Some time ago, I wrote a very comprehensive blog post about that.
My RPM specfile can be downloaded from GitHub. Before creating the package, two files need to be moved:
$ wget https://github.com/stdevel/oracle-instantclient11.2-dummy/archive/master.zip $ unzip master.zip $ mv oracle-instantclient11.2-dummy-master/*.spec ~/rpmbuild/SPECS/ $ mv oracle-instantclient11.2-dummy-master/foo.bar ~/rpmbuild/SOURCES/ $ rpmbuild -ba ~/rpmbuild/SPECS/*.spec
The new package pretends to provide the requires libraries:
$ rpm -qp --provides oracle-instantclient11.2-dummy-1.0-1.el6.x86_64.rpm ... libocci.so.11.1()(64bit) libclntsh.so.11.1()(64bit)
Afterwards, perl-DBD-Oracle can be installed:
# yum localinstall perl-DBD-Oracle*.rpm oracle-instantclient*.rpm ... Installed: oracle-instantclient11.2-basic.x86_64 0:184.108.40.206.0-1 oracle-instantclient11.2-dummy.x86_64 0:1.0-1.el6 perl-DBD-Oracle.x86_64 0:1.74-1.el6 Complete!
Maybe this issue will be fixed in a later version of the Instantclient – die current version 220.127.116.11.0 is also affected. 😉