Name: [071] Horst Jens
Member: 114 months
Authored: 56 videos
Description: Hi, my name is Horst JENS, living in Vienna, Austria. I teach children how to program open source games (mostly using python / pygame): My own python game book project can be found at For more videos, check out my youtub ...

Ubuntu: Making a .deb package out of a python program (English) [ID:107] (1/1)

in series: Ubuntu: Making a .deb package out of a python program (English)

video tutorial by Horst Jens, added 03/07

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

In this video i show how to take a small Python program (a little game) and transform it into a .deb-package for Ubuntu Linux. The process should be the same for all Debian-based Linux distros.

This screencast was done on a German Ubuntu system, but voice and documentation in the Wiki are all in English. The video is about 15 minutes long.

You can find all example codes and documents in the Wiki.


Creative Commons Attribution, Non-Commercial, Share-Alike (BY NC SA)

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 196 (since July 30th)
  • Plays in last week: 0
  • Published: Sometime before 1st March 2007 (in other words - we don't remember!)

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>

All comments excluding tick-boxed quick-comments

60. BelvinmaF Tue, 15 Jun 2010 08:05

Excellent tutorial, although abit too verbose and detailed for people experienced with Linux. I would expect most people interested in making packages would at least have experience with terminal commands! But that's just a minor point.

59. mbt swala caviar Thu, 13 May 2010 10:00

Was building my Debian packages using "dpkg -b" in the past and all files created manually from Debian Policies. Will investigate Deb Helper scripts further since they seem to simplify job of a package maintainer quite a bit.

58. Sat, 08 May 2010 08:30

Very very useful. It seemed some of the functions had been updated or changed since release, so remake would be very valuable. However, it served my purpose with a few adaptions so thank you so much!

57. jasa SEO, Backlink, Blogwalking murah Wed, 31 Mar 2010 12:21

very nice video..

56. anonymous Wed, 30 Dec 2009 12:45

Now I understand how it goes :) Very thanks.

100s of thank you!

100s of thank you!

53. anonymous Mon, 07 Dec 2009 06:09

Very nice, helped me a lot and hope to see more of these. pity some of them are Chinese.

Thank you.

52. anonymous Fri, 27 Nov 2009 00:17

하루 3만원 무료로 드립니다.

하루 3만원 무료로 드립니다.

하루 3만원 무료로 드립니다.

하루 3만원 무료로 드립니다.

하루 3만원 무료로 드립니다.

순장, 이혜원 ,이혜원미니홈피, 파상풍주사, 김산호, 이특 , 이혜원중국쇼핑몰 , 안정환 , 레이디컬렉션, 정해리미니홈피 , 임효성 , 채소연, 켈란루츠 , 그그그 , 좀비춤

51. anonymous Thu, 26 Nov 2009 10:01

A great place for people to start.

Whilst some have commented that it's not fully the debian/ubuntu way - I think this is an excellent "low barrier to entry" piece of documentation that allows people to start packaging python things.

So much of Debian's deep, dark interiors are so complex with documentation that assumes you already know a lot. Here, you start with the basics.

You get my vote...

50. anonymous Fri, 25 Sep 2009 02:39

thanks great video

49. anonymous Mon, 21 Sep 2009 14:04

로또가 별거냐...............

2009야마 토ngg버젼75연타가능

3만원내고 벤즈 구입할기회,

정직한 야마토, 절호의찬스,ㅡ,

48. anonymous Tue, 08 Sep 2009 13:03

Thanks. That video is fantastic. A big help!

47. anonymous Tue, 08 Sep 2009 11:35

OK, more feedback for you. The feedback system is awful! It keeps stopping the very interesting vid!

Please take charge of it!

46. anonymous Tue, 08 Sep 2009 11:28

Good so far... got to 6 mins and then it asked me for feedback... hopefully it will work in the end!

45. anonymous Tue, 25 Aug 2009 18:14

Very helpful! Thank you Horst.

44. anonymous Wed, 05 Aug 2009 13:43

Thank you very much for providing this tutorial, I found it very well-paced, well-prepared and informational. I was a bit overwhelmed with the complexity, especially the fact that you need to modify the source to make it work (how do you test that?). I wonder if checkinstall does an equivalent job or if it is worse. Thank you again for a great presentation!

43. anonymous Mon, 27 Jul 2009 10:30

it's fine! I like it and I learned a lot, but I wanted to know in wich directorys I need put an python module :)

42. anonymous Wed, 15 Jul 2009 09:31

This is giving me a jump start on building a debian package for my python program, thanks!

41. anonymous Wed, 15 Jul 2009 00:43

Thanks for making the video - I am just learning Debian packaging and this was the first explanation that told me about dh_make, etc.

Do you intend to expand your video to include details about how to use python-support? I am really struggling with it (but I have only spent a few hours, so far).

(Python-support in *one* of the systems of making sure that you get all of the correct pycs generated for all your system's installed versions of Python.)

I *think* that using either python-support or pycentral is required to make "real" Debian packages from Python packages (rather than from just a single module). By "real", I mean packages that have a chance of getting into the official Debian/Ubuntu repositories.

Is my understanding correct?

Thanks again for making this video.


40. anonymous Fri, 10 Jul 2009 16:40

Really welldone video!

Easy to hear and to understand anything.

39. anonymous Thu, 09 Jul 2009 10:40

Really useful!! It is just what I needed to watch.

Thank you!

38. anonymous Sat, 20 Jun 2009 11:31

Excellent tutorial!

37. anonymous Thu, 11 Jun 2009 01:14

hi frnd,

This is nice ,i have problem in installind sudo apt-get install any packages what i should do ,what i should do plz say

36. anonymous Thu, 11 Jun 2009 01:14

hi frnd,

This is nice ,i have problem in installind sudo apt-get install any packages what i should do ,what i should do plz say

The documentation to this video (including presentation in pdf and open-office format as well as code examle) is linked in the wiki page for this video:

34. anonymous Mon, 08 Jun 2009 09:52

I'd prefer to see this as a document, rather than a screencast.

33. anonymous Wed, 27 May 2009 12:15

Pretty good tutorial. Thanks a lot.

32. anonymous Thu, 07 May 2009 22:59

I got one working! Now to start making a more real example. Thanks heaps from Auckland, New Zealand.

31. anonymous Wed, 31 Dec 2008 04:52

Review of Ubuntu: Making a .deb package out of a python program (English)

Thanks for doing that - wish I'd found it when I started debbing by python code!

Just one comment: it would be better to use fakeroot (or similar) rather than sudo - the user may not be able to sudo, and root access to home dirs can be problematic, e.g. in nfs with root-squashing.

30. anonymous Wed, 31 Dec 2008 04:46

* Architecture should be "all" (if there are no Python extensions - .so files) i.e. package can be build on one architecture and used on all others ("any" will be build separately on all architectures)

* non-Debian-specific patches should be sent upstream and I guess disabling support for other OSes will not be accepted

* building the package with root privileges is not a good idea, use fakeroot or `debuild` command (which will invoke fakeroot)

* instead of deleting ../*.orig.tar.gz you should `mv ./packagename-version.tar.gz ../packagename_version.orig.tar.gz`

* BTW: there are examples (Makefile based apps, based apps, etc.) on, I guess it's easier to copy debian dir from one of existing packages. There's also #debian-python channel @ OFTC network

Great video. Thanks

28. anonymous Thu, 11 Dec 2008 15:31

hi horst...

I am trying to create a .deb package with some perl scripts and some .rules file. I am getting the following error

dpkg-buildpackage: set CPPFLAGS to default value:

dpkg-buildpackage: set CFLAGS to default value: -g -O2

dpkg-buildpackage: set CXXFLAGS to default value: -g -O2

dpkg-buildpackage: set FFLAGS to default value: -g -O2

dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions

dpkg-buildpackage: source package rusbserver

dpkg-buildpackage: source version 1.1.1-1

dpkg-buildpackage: source changed by karthik

dpkg-buildpackage: host architecture i386

debian/rules clean

debian/rules:15: *** missing separator. Stop.

dpkg-buildpackage: failure: debian/rules clean gave error exit status 2

pls do help me how should i proceed...

if using gedit, check the menu option : edit -> preferences -> editor.

make sure that the option "replace tabs with spaces." is NOT checked.

Please publish an email address (or register yourself at showmedo) when posting questions.

26. anonymous Sun, 07 Dec 2008 18:07

I have the same error! How can I correct the rules file with the needed TABS? I used gedit.

25. anonymous Tue, 18 Nov 2008 22:49

just to say that I solved the problem I described just above :

you *REALLY* need TABS in rules. It won't work if you edit it with an editor which is set to replace TABS by spaces.

24. anonymous Tue, 18 Nov 2008 20:55

Great video (except for the very low volume), but I'm getting an error and I just can't find out why (google didn't help ... just brought me back here)

here is the tail of the dpkg-buildpackage output :

dpkg-buildpackage: host architecture i386

debian/rules clean

debian/rules:15: *** missing separator. Stop.

dpkg-buildpackage: failure: debian/rules clean gave error exit status 2

any idea where that might be coming from? My rule file looks very very much like yours.

23. anonymous Thu, 25 Sep 2008 19:27

Sehr schoenes Video, gerade weil sich die meisten Anleitungen im Netz um 'configure' und 'make' files drehen. Deshalb hats mich sehr gefreut, dazu so ein "anschauliches" Tut zu Python zu finden.

Review of Ubuntu: Making a .deb package out of a python program (English)

That's really a good effort.

I thought of writing at least something in addition to quick comment. I Just want to honor your work and time that you spend for us making knowledge.


21. anonymous Mon, 07 Jul 2008 07:43

I've found the origin of my problem (the previous comment):

I did NOT move the .tar package from my project directory.

So I've solved so:

dh_make [arguments...] myproject.tar.gz

It has generated the archive "myprobject.orig.tar.gz" in the parent directory.

I've moved "myproject.tar.gz" (NOT orig.tar.gz) in the parent directory, and I've given "dpkg-buildpackage" (it can be done also without root privileges).

However, very good video!

Thank you very much ;)

20. anonymous Sun, 06 Jul 2008 05:26


I don't understand why I receive this error:

Can you help me?

Thank you ;)

19. anonymous Wed, 27 Feb 2008 17:44

Thank you very much this video was very useful for me. thanks

Now to complement this an approach using a Python egg first, and then build a Debian package would be interesting. I would suppose some meta data and some steps would be quite eased.

Hey man, this is great stuff. Thanks a lot, now I can make lots of little python apps and share them with friends and all I need to do is pass them a simple .deb package :D . Great work and keep it up!

16. anonymous Tue, 12 Feb 2008 06:24

very nice to have walk through of deb package creation process.

I found the German interface to be a bonus. I hadn't seen

a native speaker of another language using Ubuntu before!


Horst, I thought you'd like to know that your video has sparked-off a nice thread:

"I am trying to make a debian package. I am following the tutorial by Horst Jens ([link]) and it is very informative. However one thing my app has and his doesn't, is multiple python files which need to be executed. For example ..."

Good job,


Thanks for making this video! I've wanted to try making a debian package for a long time. It looks complicated and I'm sure I'll be referring to this video a lot when I try it on my own.

Review of Ubuntu: Making a .deb package out of a python program (English)

hiermit schreibe ich das erste Review auf showmedo überhaupt...gleich einmal über mein Video. Fazit: Stark verbesserungsbedürftig, ein Remake wäre angebracht.

Nice to see this, I do not have Ubuntu, but probably will use it later in the future, seeing how wonderful it can be.

11. anonymous Sat, 10 Nov 2007 16:01


Thanks for this video

9. anonymous Fri, 17 Aug 2007 14:47

Thanks for this video - It helped me build my very first debian package

You made a very helpful and informative video, Horst! I use both Python and Debian/Ubuntu, but have never attempted to make a Debian package before. This video encouraged me to make one for an upcoming Python project. Thanks!

7. anonymous Wed, 20 Jun 2007 12:06

Thanks very much for this video, it's been really helpfull. Keep up the good work!

Yeah, the interface is in German, because i was working with an German Ubuntu Desktop. Meanwhile i know how to set up an English Desktop. If i ever make a better version of this video it will be complete in English.

5. anonymous Tue, 01 May 2007 14:59

just some minor problem with the video.. the graphical interface is not in english, although the audio track is.

I'm glad to hear that. Sorry for the low quality, it was my first video. If i accumulate more knowlege i will eventually re-do this video..

3. anonymous Mon, 16 Apr 2007 23:38

Helped ne as well ^^

Thank you Horst for this great tutorial! I'm sure it will help me a lot.

Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for Horst

Python: Leo shows how the Buttonbox function of EasyGui (German / English subtitles)

Cool and quick start for easygui !

Supply Big Bargains Wholesale Marlboro Gold Regular Cigarettes 3 Cartons Hunt No Further, The Values Are Here
70 months ago


Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.