Introduction to Debian Maintainer Script Flow Charts

Upgrading a packagehttps://www.



htmlLet’s talk about the package upgrade.

Assume you have already installed package foo version 1.


3 in your machine.

Now you wish to install new version of foo package that is 1.



Well, you have find that this is a much complex process and flow entrancement.

However, if you have looked carefully this is a simple and easy process.

When you configure your scripts according to this process consider each flow one by one and handle them in your scripts.

it will give much simpler approach to control the upgrade scenario.

If the debian system detect that, the package has been installed with old version it will start the automate process by older version script files.

As an example this scenario process start with prerm script of foo package 1.


3 version.

This script will get two argument such as upgrade and 1.


4 (new version).

If this script run perfectly, then preinst script of foo package 1.


4 version will start to execute it’s tasks using given arguments.

After that, again old version’s files will be executed with two arguments such as postrm script of version 1.



Then these process will flow as given in the above diagram.

If you can lookup the diagram with each flow by flow separately, you will understand it easily.

????.Removing a packagehttps://www.



htmlThis scenario consider about removing a package from the system.

First, you need to understand the different between remove and purge.

In remove process we need to delete all the package files that we unpacked during the installation.

However, in the remove process we could not delete the configuration files and files that are created during the package running on the machine.

These files will exist after the remove process.

In purge process all the files that related to the package will be deleted from the system.

????.Purging a package previously removedhttps://www.



htmlWe you want to delete configuration files after the removing the package, you can delete these configurations with purge process.

In this purge process you can only handle the scenario with postrm script.

????.Removing and purging a packagehttps://www.



htmlWe you have run the purge process in debian package management system, it will do the process according to above given path.

First it will run the postrm script with remove argument value and then again run the same postrm script with purge argument value.

You need to handle these argument in your postrm script to do needful tasks according to the given argument.

If you need to generate or modify your custom debian package of your application, you should have a perfect understanding of these maintainer script flow charts.

Once you know the basics, it is easy to build your own debian packages for your applications.

Hope this article helped you to get these basic understanding of debian installation.

????Cheers!!!.????????Prefer for more details:Debian New Maintainers' GuideMaking a Debian Package (AKA the Debmake Manual), copyright © 1997 Jaldhar Vyas.



orgApt – Debian WikiMuch of why Debian is a strong Linux distribution comes from the core of Debian namely its package management…wiki.


org.. More details

Leave a Reply