Skip to content

Instantly share code, notes, and snippets.

@edwardstock
Last active December 9, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardstock/d55bfdb0a1ed81a41b5d81c9f815f9a6 to your computer and use it in GitHub Desktop.
Save edwardstock/d55bfdb0a1ed81a41b5d81c9f815f9a6 to your computer and use it in GitHub Desktop.
How to create DEB package

Step-By-Step guide how to create .deb file from your files

  1. sudo apt-get install devscripts build-essential lintian
  2. Create a directory with prebuild binaries, for example: myproj_1.0.0.orig
  3. myproj_1.0.0.orig must contains a linux file structure, for exampel: binaries should be in myproj_1.0.0.orig/usr/bin, libraries in usr/lib or usr/lib64 et cetera..
  4. Create tar.gz from directory: tar -zcvf myproj_1.0.0.orig.tar.gz myproj_1.0.0.orig
  5. cd myproj_1.0.0.orig
  6. mkdir debian
  7. dch --create -v 1.0.0-1 --package myproj - this command may ask you about preferred editor, select one
  8. Write changelog respecting syntax:
  • asterisk (*) - what was changed, if new, just leave "initial release"
  • -- author, write your name and email
  1. echo "10" > debian/compat
  2. create file control in debian
  • Example:
Source: myproj
Maintainer: Mike Smith <liw@liw.fi>
Section: misc
Priority: optional
Standards-Version: 4.2.1
Build-Depends: debhelper (>=10), !!! write dependencies here in format: package-name (version_name), comma_separated (version_name)

Package: myproj
Architecture: !!! any (arch doesn't matter) or all or i386 (fox x86) or amd64 (for x86_64) https://www.debian.org/doc/manuals/maint-guide/dreq.html#control
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Write your
multiline description
  1. Write copyright to debian/copyright
  2. Paste to debian/rules:
#!/usr/bin/make -f
%:
   dh $@

note: The last line should be indented by one TAB character, not by spaces. The file is a makefile, and TAB is what the make command wants

  1. mkdir debian/source && echo "3.0 (quilt)" debian/source/format

  2. Now, in current root directory (myproj_1.0.0.orig), run: debuild -us -uc

  3. cd .. && ls

  4. Done.

For more information about errors and advanced configuration, read official doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment