How to: Compile packages on Debian/Ubuntu by hand

In some very rare situations you may find yourself in the need to recompile a Debian (or Ubuntu) package. Luckily for all of use, the great Debian packaging system makes this a piece of cake. Let’s say we want to recompile mod_python for apache 2 to hook in to python 2.5, instead of the default 2.4. First, get every thing installed you may need to build the libapache2-mod-python package. $ apt-get build-dep libapache2-mod-python Okay, next let’s grab the source for the package.