How to compile Debian packages

  • Install needed tools:
    apt-get install devscripts dpkg-dev
  • Install packages needed to compile the package:
    sudo apt-get update
    sudo apt-get build-dep PAKET

    (This only works if the package is available via apt-src entries in sour apt-sources)
  • If the package is available via ‘deb-src’ the sources can be downloaded and compiled directly:
    sudo apt-get update
    fakeroot apt-get -b source PAKET
  • Alternatively you can download the three source files (*.orig.tar.gz, *.diff.gz or *.debian.tar.gz and *.dsc) with ‘dget’:
    dget http://somurl/package.dsc
  • Unpack it:
    dpkg-source -x paket*.dsc
  • Change to the package dir:
    cd paket*
  • Compile it with
    -S only build the source package
    -b only compile a prepared source package
    -sa add orig.tar.gz to the *.dsc file
    -sd not add orig.tar.gz to the *.dsc file
    -us not sign the source
    -uc not sign the chnages
    -b no sources
    -B no architecture-independent
    ‘debuild’ is a wrapper for ‘dpkg-buildpackage’ which could also be called directly