Shortround.net Articles

Recompile an Ubuntu Package

Every once in a while, I need a newer version of a package that isn't available in my current version of Ubuntu. To remedy this, I grab the package information from a newer version of Ubuntu and recompile it. Go to the Ubuntu archive and hunt down the software you need. You will need three files. First, you need the tarball of the original source. Next, you need the diff file for the changes needs for the distribution. Lastly you need the description file. For example, in the universe/h/hylafax folder, you need the following files:

  • hylafax_4.3.1.orig.tar.gz
  • hylafax_4.3.1-3.diff.gz
  • hylafax_4.3.1-3.dsc

Now we can build the package and install it. The following code grabs the dependencies needed to build the package, builds it and then installs it. Make sure you have the fakeroot package installed before you do this.

# sudo apt-get build-dep package
# dpkg-source -x package.dsc
# cd package-version
# dpkg-buildpackage -rfakeroot -b
# dpkg -i ../*.deb

Note that this may not work for some packages, because newer packages may require dependencies that you cannot build for your system.

This was posted on Friday, July 25, 2008 at 16:01. It is filed under Ubuntu.
It is licensed under the Creative Commons Attribution 3.0 Unported License. View the markdown for this article.