Link to home
Start Free TrialLog in
Avatar of Frosty555
Frosty555Flag for Canada

asked on

Debian packages and "upgrade" support

Hi guys,

I'm designing a product, written in C and runs on a standard installation of Debian Lenny.

We install it to our own dedicated hardware (basically an Intel Xeon server) via a locally managed debian repository. We use Debian's normal package management system to deploy and upgrade the product.

It is installed on our own hardware so we have rigid control over exactly what is on every machine.

Currently our package installation scripts - postinst, preinst, postrm, prerm, etc. have support for installing, removing, and purging the package that contains our software.

I have been tasked with implementing "upgrade" support. Currently the only functionality we have to upgrade the software is to remove the existing package, and reinstall the new one - it is destructive to our configuration, database, etc. which is obviously not ideal.

I don't really know how Debian's package manager handles "upgrades".

I know there are places where you can hook in to the upgrade process, e.g. preinst and postinst are called with  "upgrade" arguments. I am currently studying this document:

http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

But I was hoping I could get your expert opinions on how Debian package upgrade works from a package-developer's point of view and generate some high-level discussion on what I should be doing and looking for as far s implementing upgrade functionality in our package system goes.

Thanks!
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

This is just a thought, not actually Debian upgrade doing.

For update/upgrade package, in deb package file, it contains the file list as meta data.
So, group those files into binary, document (man page) and configuration files.
When update, compare the file list,
1. overwrite the exist ones (files) except for the configuration files. New configuration files install as <filename>_debnew

2. delete those files in previous version only (Need to have file list comparison result).

3. Update the deb meta database for new version installation (with new files installed list).

So you don't need to uninstall the previous version.
So of packages like server/daemon need to in preinst to check the daemon running status and shut it down
before file overwriting.
ASKER CERTIFIED SOLUTION
Avatar of Frosty555
Frosty555
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frosty555

ASKER

found whitepaper on the subject
I realize looking at my comments now that the document I just posted is actually exactly the document I was talking about in my original question.... how about that!

I think what has happened here is that now I've spent some time diving into debian packages and understanding how they work, I finally UNDERSTAND that document. I didn't really know what it was talking about before, but now that I have done more research I have a better context and high level understanding of Debian packages from a developer's point of view, I understand the document and it is exactly the information I needed.

That high level overview of Debian package maintainer scripts from a developer's perspective was what I was trying to discuss in this question - I was hoping for a little more response. Oh well.