Installation of Oracle client to Ubuntu 10.04 Lucid

Recently I moved from Fedora 13 to Ubuntu 10.04 on my work laptop. So, I faced again with problem to setup Oracle PHP interface. Oracle provides RPMs only and not DEBs. So, to install the client RPMs should be converted to the DEBs. It can be done easily using utility alien:
sudo alien oracle-instantclient11.1-basic-
sudo alien oracle-instantclient11.1-devel-
sudo alien oracle-instantclient11.1-sqlplus-

They can be installed then with sudo dpkg -i.
Don’t forget to install PHP interface to Oracle:
sudo pear install pecl/oci8
That’s it. I spent no more 15 minutes to setup PHP Oracle interface under Ubuntu. Thanks to that post!

How to rebuild Ubuntu package from the sources

There are two ways (at least) to rebuild Ubuntu package from the source.
Using Ubuntu diff file and dpkg-buildpackage

  • Download source from Ubuntu repository.
  • Download Ubuntu diff file and apply it:
    patch -p1 < ubuntu.diff
  • Build package:
    dpkg-buildpackage -rfakeroot

Using .dsc file and debuild

  • Download .dsc file
  • Run following command:
    dpkg-source -x file.dsc
    Note, sometimes the archive with sources should be presented in the same directory!
  • Go to source directory and start building:

In both cases the development packages should be installed first:
sudo apt-get install build-essential devscripts