Solved

Debian packages and "upgrade" support

Posted on 2011-09-02
4
420 Views
Last Modified: 2012-05-12
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!
0
Comment
Question by:Frosty555
  • 3
4 Comments
 
LVL 38

Expert Comment

by:wesly_chen
Comment Utility
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.
0
 
LVL 31

Accepted Solution

by:
Frosty555 earned 0 total points
Comment Utility
Hi Wesly,

While I appreciate your suggestions, we're reinventing the wheel which is exactly what I was trying to avoid by using debian's existing (and already very mature) package upgrade system.

I found this document:

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

Which precisely describes what I was looking for - a good description of the Debian package scripts, and a precise specification for exactly how an upgrade happens from a developer's point of view.
0
 
LVL 31

Author Closing Comment

by:Frosty555
Comment Utility
found whitepaper on the subject
0
 
LVL 31

Author Comment

by:Frosty555
Comment Utility
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.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now