Introduction

Sometimes you need to recompile some software. But when using Debian packages, it’s not always easy because you want to keep the Debian conveniences. The solution is apt-get source :-)

Installation

We will need these packages:

1
aptitude install dpkg-dev

Example

For example, I want to install nginx but recompile it with an additional option. I download the sources as follows:

1
apt-get source nginx

Then I have a directory containing the sources and I reconfigure my sources with ./configure.

After that, all that’s left is to recreate the package:

1
dpkg-buildpackage -us -uc

You may be missing some packages that will be indicated afterwards (usually autotools-dev). Install them and restart the above line.

Then install the package like this:

1
dpkg -i nginx.deb

Last updated 28 Mar 2010, 20:27 CEST. history