Recompile a Ubuntu PPA package on Debian

One of the annoying things with Ubuntu PPAs is that they almost never install out-of-the-box on Debian, because usually they need a too new version of a package or a too old one, depending on which Ubuntu version you choose.

Fortunately, since both Debian and Ubuntu share the same package system, so recompiling and repackaging a PPA package is often very easy, since the source code already comes ready for packaging. Here are the steps to follow :

  1. Install build-essentials and dpkg-dev packages

  2. On the PPA page on Launchpad, click the "view package details" link and expand the most recent version.

  3. Download 1) the .orig.tar.gz file (the original source code), 2) the .dsc file (the debian package specification) and 3), if existing, the .debian.tar.xz (the patches applied by the debian team, usually needed to make the source code comply with debian rules).

  4. Place both in a same folder, then extract everything:

    dpkg-source -x name-of-dsc-file.dsc

  5. Go to the extracted folder:

    cd name-of-folder

  6. Compile the code:

    dpkg-buildpackage

  7. If some needed package dependencies are not installed, the above command will abort now and tell you what is missing. Correct the situation and run dpkg-buildpackage again. Compiling might take some time.

  8. Is all went well, you will find one (or more, since the dsc file might have instructed to split into several packages) .deb files in the folder that contains your dsc file. Install it by double-clicking it in your file manager or with:

    sudo dpkg -i name-of-package.deb

Retrieved and adapted from http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-package/