Errorenous Oracle Instantclient RPM provides under Enterprise Linux

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:

1# yum install perl-DBD-Oracle
2...
3--> Finished Dependency Resolution
4Error: Package: perl-DBD-Oracle-1.74-1.el6.x86_64
5           Requires: libocci.so.11.1()(64bit)
6Error: Package: perl-DBD-Oracle-1.74-1.el6.x86_64
7           Requires: libclntsh.so.11.1()(64bit)
8 You could try using --skip-broken to work around the problem

However, the files exist on the file system:

1# rpm -ql oracle-instantclient11.2-basic|egrep "clntsh|occi"
2/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
3/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:

1$ rpm -qp --provides oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
2oracle-instantclient11.2-basic = 11.2.0.4.0-1

Here are various missing entries including the libraries mentioned above. The perl-DBD-Oracle RPM package requires these files:

1$ rpm -qp --requires perl-DBD-Oracle-1.74-1.el6.x86_64.rpm
2...
3libclntsh.so.11.1()(64bit)
4libocci.so.11.1()(64bit)
5...

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:

1$ wget https://github.com/stdevel/oracle-instantclient11.2-dummy/archive/master.zip
2$ unzip master.zip
3$ mv oracle-instantclient11.2-dummy-master/*.spec ~/rpmbuild/SPECS/
4$ mv oracle-instantclient11.2-dummy-master/foo.bar ~/rpmbuild/SOURCES/
5$ rpmbuild -ba ~/rpmbuild/SPECS/*.spec

The new package pretends to provide the requires libraries:

1$ rpm -qp --provides oracle-instantclient11.2-dummy-1.0-1.el6.x86_64.rpm
2...
3libocci.so.11.1()(64bit)
4libclntsh.so.11.1()(64bit)

Afterwards, perl-DBD-Oracle can be installed:

1# yum localinstall perl-DBD-Oracle*.rpm oracle-instantclient*.rpm
2...
3Installed:
4  oracle-instantclient11.2-basic.x86_64 0:11.2.0.4.0-1
5  oracle-instantclient11.2-dummy.x86_64 0:1.0-1.el6
6  perl-DBD-Oracle.x86_64 0:1.74-1.el6
7
8Complete!

Maybe this issue will be fixed in a later version of the Instantclient - die current version 12.1.0.2.0 is also affected. 😉

Translations: