< Previous | Contents | Next >
Installation and Upgrade Script Sequence
Here is what happens during an installation (or an update):
1. For an update, dpkg calls the old-prerm upgrade new-version.
2. Still for an update, dpkg then executes new-preinst upgrade old-version; for a first in- stallation, it executes new-preinst install. It may add the old version in the last parame- ter if the package has already been installed and removed (but not purged, the configuration files having been retained).
3. The new package files are then unpacked. If a file already exists, it is replaced, but a backup copy is made and temporarily stored.
4. For an update, dpkg executes old-postrm upgrade new-version.
5. dpkg updates all of the internal data (file list, configuration scripts, etc.) and removes the backups of the replaced files. This is the point of no return: dpkg no longer has access to all of the elements necessary to return to the previous state.
6. dpkg will update the configuration files, prompting you to decide if it is unable to automat- ically manage this task. The details of this procedure are discussed in section 8.4.3, “Check- sums, Conffiles” [page 214].
7. Finally, dpkg configures the package by executing new-postinst configure last- version-configured.