OSBN/Ubuntuusers Planet RHEL / CentOS XING / LinkedIn / Amazon

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:

# 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"

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-
oracle-instantclient11.2-basic =

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

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 “forcingrpm 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

Afterwards, perl-DBD-Oracle can be installed:

# yum localinstall perl-DBD-Oracle*.rpm oracle-instantclient*.rpm
  oracle-instantclient11.2-basic.x86_64 0:
  oracle-instantclient11.2-dummy.x86_64 0:1.0-1.el6
  perl-DBD-Oracle.x86_64 0:1.74-1.el6


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

Sharing is caring

2 Comments Add New Comment

Leave a Reply

Your email address will not be published. Required fields are marked *