[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: utility to downgrade a package with its dependencies?

On Thu, Jan 05, 2012 at 03:43:22PM +0100, Vincent Lefevre wrote:
> For Debian/unstable:
> Does there exist a utility to downgrade a package with its
> dependencies and reverse-dependencies? The old packages would
> be taken from /var/cache/apt/archives, and the tool should be
> able to find automatically which packages/versions are needed
> to satisfy all the dependencies (with minimum change) and
> should be able to handle virtual packages.

Typically there isn't.

The big problem with rolling back packages is the maintainer scripts
(post-install, pre-remove etc). These are generally written in such a
way as to facilitate UPgrades.

For example, imagine that package Foo upgrades its configuration when
moving from version 1 to version 2. The maintainer provides a script
that converts from the old format to the new format when upgrading.
You now re-install the old package (which, of course, doesn't know
about the new format configuration). Not only does the old package not
convert your configuration to the old format, but it doesn't know how to
read it either.

I was in this situation myself a while ago and decided that the best
solution was as follows:
	* Before upgrading, take an LVM snapshot (this, of course, assumes
	  you ARE on LVM).
	* Perform the package upgrade and then test the new version.
	* If happy, delete the snapshot (this is a cheap operation)
	* If unhappy, rollback the snapshot (which takes a bit of time, but
	  gets you back to where you were).

Obviously, any other changes you made between the snapshot and the
rollback would also get rolled back.

Darac Marjal

Reply to: