Child pages
  • debian package Primer
Skip to end of metadata
Go to start of metadata

Creating new Debian (deb) packages

You need dh_make to create the initial ./debian directory.

you@machine:package-name$ dh_make -n -s -p package-name_0.1
Maintainer name : Your Name
Email-Address   :
Date            : Thu, 31 Mar 2011 19:47:38 -0400
Package Name    : package-name
Version         : 0.1
License         : gpl3
Using dpatch    : no
Using quilt     : no
Type of Package : Single


The important files are

  • control
    • The metadata about the package
  • rules
    • The build makefile. Edit this if you don't use make.

More Configuring

  • copyright
    • Enter relevant copyright information.
    • Replace this with your README

Test the package

# Use -us -uc to skip the gpg signing on *s*source and *c*hanges
$ debuild -us -uc

This will try to build the package and then run lintian, which will tell you that your packaging job is crap. Fix the warnings and errors. The package will be created at the parent directory (of your current working directory).

Now goto 10 – continue configuring.

Clean up hints

Go into ./debian and try to remove any .ex or .EX files that you don't need.

Tips for Python packages

Since python does not use make, the first debuild will not work. You need to edit debian/rules .

target name





python build


$(MAKE) clean

rm -rf build


$(MAKE) DESTDIR=$(CURDIR)/debian/package-name install

python install --prefix=$(CURDIR)/debian/package-name/usr

The control file should be edited with the right dependencies (at the minimum python).


  • No labels