Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just want to use an Ubuntu package from the official Ubuntu repos, modify its source just a tiny bit (it will not affect dependencies or anything) and then upload it into a Launchpad PPA I made for it.

I don't want to become a professional Ubuntu package maintainer, so reading all the docs about creating an Ubuntu package from scratch is overkill for me.

So, are there some simple steps to take for this task?

PS: I'm doing this because of this bug in bpython and other things I may not like about Ubuntu packages in the official Ubuntu repos.

share|improve this question
I assume it's about sharing for good. – Andrejs Cainikovs May 22 '12 at 16:57
@harisibrahimkv As Andrejs Cainikovs said: sharing. And maybe there will be more than this package I want to modify. Installing them all from source is not very comfortable. – dAnjou May 22 '12 at 16:59
If you have a fix, find a corresponding bug against the package (or file a new one), and include the patch. That way the patch gets shared and included in future Ubuntu versions (this way you also don't become a professional maintainer, since all maintainers are pretty much volunteers already) – Thomas Ward May 29 '12 at 16:47
Please remember to accept/upvote the best answer(s) to your question when possible (tick/check mark on the left). This way, the question is marked as "answered" and future readers can refer to it knowing the solution works. Thank you...:) – izx Sep 8 '12 at 7:48

So, are there some simple steps to take for this task?

It is only "simple" if you start with a package that exists in the Ubuntu or Debian repositories. Here's an outline:

  1. Use apt-get source to download the sources/diffs for the package and apply them.
  2. Go in inside the directory, apply your patches/make your changes.
  3. Use dch to update the Changelog with what you modded and "name" your custom version (usually a `ppa1~series1 type designation).
  4. Run debuild -S -sd or debuild -S -sa, depending on whether your original package sources exist in the target series repository or not.
  5. gpg-sign the package when prompted (the key'll need to be registered on Launchpad).
  6. Use dput to upload the xxxxxx.changes file to Launchpad, which will also include the diffs and maybe the source depending on what debuild switches you built
  7. Relax and keep checking your PPA for the build status/updates.

If you are backporting or using bleeding-edge Debian Sid sources, etc., it's a good idea to set up a chroot and between step 3 and 4, run dpkg-buildpackage -us -uc to nip any dependency issues in the bud.

share|improve this answer
Thanks, I will look into that soon. – dAnjou May 30 '12 at 9:39
Of course, I just had no time to try it yet, sorry. – dAnjou Jun 3 '12 at 11:15
When I was trying to do this, I found one step was missing. Before you debuild the package, you need to "dpkg-source --commit" if you've made changes to the package. This creates a patchfile containing your changes. debuild failed until I did that. – mandreko Jan 16 '14 at 15:43

Why not go one step further and share your bug fix with all other Ubuntu users?

The packaging guide has a fairly straightforward howto on the topic. You don't have to "read all the docs".

share|improve this answer
Not an answer to my question but definitely something I will consider doing. Thanks. – dAnjou May 30 '12 at 9:39
Actually it is. Publishing in a PPA isn't very different to getting the bug fix into the archives. – tumbleweed May 30 '12 at 10:14
Except that I don't have to wait for the next release because my change will not be considered as a security issue. Or am I missing something? – dAnjou May 30 '12 at 12:19
Right, but the work required is substantially the same, just different paperwork :) If it's a serious issue it can be fixed in -updates. And, if nobody fixes the issue in the next release, it won't be fixed then either. – tumbleweed May 30 '12 at 19:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.