Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 11 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
add comment

Your Answer

 
discard

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.