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 recently started building Ubuntu packages for my software on Launchpad. They are pretty simple; most of them just contain some files and scripts that are trigged through the .install .preinst .postinst .prerm and .postrm files. Installation and removing seems to work OK. However, upgrading from one version to the next is tricky.

What exactly happens when a package is being upgraded? Is it the same thing as uninstalling the previous version and installing the new version? Are all the files from the previous packages removed, and replaced with the files in the .install list from the new package? Are all of the .prerm, postrm, preinst, postinst scripts executed? How do I distinguish stuff that should only happen during a 'new install' and an upgrade?

share|improve this question
up vote 13 down vote accepted

The debian wiki is pretty much usefull to understand the process (which is explained in details here).

For example :

  • the case of a simple installation of package

    enter image description here

    • the case of a the upgrade of a package

enter image description here

share|improve this answer
+1 just for including the image :) – Rinzwind Jan 12 '12 at 9:14
Can't believe you're the first one to point me to this page. Thanks this is really helpful. – Jeroen Jan 16 '12 at 7:09

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.