These are instructions for building a 'testing' package on a 'stable' system.

When running the stable distribution of debian occasionally you want to install non-stable packages, because they don't appear in stable, or features or revisions are not up to what we need on our system. To do this we have to simply compile the upstream packages in the traditional debian style.

We have on our system the pre-requisite packages to build .deb files, namely: dpkg-dev and fakeroot. Our /etc/apt/sources.list file contains the following "deb-src" lines which are duplicates of normal "deb" lines, with deb-src in front instead:

deb-src http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free
deb-src http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free

note: it is possible to add lines similar to this for unstable, but it would be better to add them when you are sure you want package source from unstable instead of accidentally getting something from unstable.

The process to install a package from something other than stable is:

  • apt-get update
  • apt-get source - this will download the orig.tar.gz, diff.gz and .dsc source files for your package, unpack them and patch the source code in a new source directory underneath the one you are currently in.
  • Look in the .dsc file for the "Build-Depends" list, verify all of those packages are currently installed on the system. Also, make sure no packages listed in the "Build-Conflicts" (if it exists) are installed.
  • cd to the source directory and type (as root) "debian/rules binary", or if you are not root, type: "fakeroot debian/rules binary" This will automatically go through all of the steps necessary to build your package.
  • Install the .deb file that was created in the parent directory: "dpkg -i ../.dev" - for example, if you
    built the smartmontools package, you would see in the parent directory the .deb file smartmontools_5.1.4-2_i386.deb, so you would do: "dpkg -i ../smartmontools_5.1.4-2_i386.deb"