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 want to start sharing .deb files that automatically add new repos to an Ubuntu installation (like the ones present in

How can I do that?

share|improve this question

You could add a postinst script to your package:

Broadly speaking the preinst [script] is called before (a particular version of) a package is unpacked, and the postinst afterwards... The postinst should still attempt any actions for which its dependencies are required, since they will normally be available, but consider the correct error handling approach if those actions fail.

An example

The Opera browser is adding itself to the /etc/apt/sources.list.d/opera.list with the postinst script:

share|improve this answer
I think it's maybe a little too much for my current knowledge. But thanks for the quick answer :) – Tiago Carrondo Sep 30 '12 at 10:14
@user26687 The complete packaging guide does not exist. – Archisman Panigrahi Sep 2 '13 at 3:35

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.