Skip to content

Recompile a Software the Debian Way

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:

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:

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:

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:

dpkg -i nginx.deb