O'Reilly logo

Ubuntu Hacks by Bill Childers, Kyle Rankin, Jonathan Oxer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #62. Create an Ubuntu Package

Package your software for easy installation on Ubuntu.

Ubuntu is built on Debian and uses the .deb package format to ensure that all software is installed in a consistent way. If you want to make your software really easy to install on Ubuntu, you need to know how to put it into a Debian package.

There is a large variety of helper tools and build suites to assist with creating Debian packages, and just about as many approaches to streamlining package creation as there are package maintainers. To fully understand how Debian packages work, start by exploring the Debian New Maintainers Guide (http://www.debian.org/doc/maint-guide), Debian Policy Manual (http://www.debian.org/doc/debian-policy), and Debian Developers Reference (http://www.debian.org/doc/manuals/developers-reference), which, between them, run to many hundreds of pages of detailed information.

This hack is a quick-and-dirty introduction to show you how to build a basic binary package as quickly as possible. It assumes that the program you want to package is in a source tarball named myprogram-version.tar.gz and can be installed with a simple procedure [Hack #59] such as:

$ ./configure
$ make
$ sudo make install

The procedure for packaging libraries and other types of software can be more involved, so consult the Debian references mentioned earlier for more information.

Start by installing some of the developer tools:

$ sudo apt-get install fakeroot debhelper build-essential \\
             lintian dh-make ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required