Version 4 (modified by james, 9 years ago)
pre stuff

Package updates in yum

Package update, simple

A new version is released upstream, or just within the repo. with local patch(es):

  • pkgA-1.2.3-4 is installed
  • pkgA-2.3.4-5 is available

In this case pkgA just updating the version in the package and rebuild, and pkgA will be updated to the new version. This is what happens 99% of the time.

Package rename

A new version is released, but it changes the name:

  • pkgA-1.2.3-4 is installed
  • pkgB-2.3.4-5 is available

The usual thing to do here is to have:

    # pkgB-2.3.4-5
    Obsoletes: pkgA <= 1.2.3-4

Now pkgA will be updated to pkgB. However note that pkgA-1.2.3-4 can be installed via. rpm, after pkgB is installed. You may want to have something like:

  # pkgB-2.3.4-5
  Conflicts: pkgA <= 1.2.3-4

...to stop that. For compatibility you may also want to do:

  # pkgB-2.3.4-5
  Provides: pkgA

...as now packages which "Requires: pkgA" will continue to work.

Package split

A package splits some of it's data into a sub-package:

  • pkgA-1.2.3-4 is installed
  • pkgA-2.3.4-5 is available
  • pkgA-foo-2.3.4-5 is available

This is a similar problem to the rename, except that we are renaming some of pkgA to one place and some to another (the same place):

  # pkgA-foo-2.3.4-5
  Obsoletes: pkgA <= 1.2.3-4

  # pkgA-2.3.4-5
  Obsoletes: pkgA <= 1.2.3-4

Now pkgA will be updated and pkgA-foo installed. Note that if you don't have the Obsolete in pkgA then it will work as a rename, which is probably not what you want.

Package merge

A package merges a sub-package into the main package:

  • pkgA-1.2.3-4 is installed
  • pkgA-foo-1.2.3-4 is installed
  • pkgA-2.3.4-5 is available

This is basically the same problem as a rename, so the solution is the same:

  # pkgA-2.3.4-5
  Obsoletes: pkgA-foo <= 1.2.3-4

Now pkgA will be updated and automatically remove the old pkgA-foo-1.2.3-4.

Package update, requires newer interface

A package depends on something else, and older versions will fail.

  • pkgA-1.2.3-4 is installed
  • pkgB-3.4.5-6 is available
  • pkgA-2.3.4-5 is available
  • pkgB-4.5.6-7 is available

The obvious solution here is:

  # pkgA-2.3.4-5
  Requires: pkgB >= 3.4.5-6

...which will bring the new version of pkgB along if pkgA is updated.

Package update, fails with older interface

A package _doesn't_ depend on something else, but older versions will fail.

  • pkgA-1.2.3-4 is installed
  • pkgB-3.4.5-6 is available
  • pkgA-2.3.4-5 is available
  • pkgB-4.5.6-7 is available

The obvious solution here is is to do the require, but in fact you want to do:

  # pkgA-2.3.4-5
  Conflict: pkgB < 3.4.5-6

...this will update pkgB, if it's already installed, but do nothing otherwise. Also note that Conflicts are on package names only, if pkgB is renamed to pkgZ at version 3.4.5-6 (and provides pkgB of the same version) then the conflict do nothing.