Making a Red Hat 6.2 install CD support 4.0.x RPM packages

For a variety of reasons some of us prefer to continue using Red Hat 6.2 rather than upgrade to 7.x. Since Red Hat 6.2 was released there have been a number of bug fix and security updates. It is convenient to create new installation CDs incorporating these updates. For details on how to do this see the Building a Red Hat CD HOWTO. Additional information can be found here.

During the lifetime of Red Hat 6.2 there have been two changes to the RPM format which have caused problems for the installer. The original version of RPM in Red Hat 6.2 was 3.0.4. In October 2000 version 3.0.5 was released. A major revision to version 4.0.2 occurred in March 2001.

After the release of 3.0.5 a small number of update RPMs appeared with a dependency on 'rpmlib(VersionedDependencies)'. The affected package files are:

   tcsh-6.10-0.6.x.i386.rpm
   php-ldap-3.0.18-1.6.x.i386.rpm
   php-imap-3.0.18-1.6.x.i386.rpm
   php-pgsql-3.0.18-1.6.x.i386.rpm
   php-manual-3.0.18-1.6.x.i386.rpm

During installation these packages are listed as having missing dependencies but with no suggestion as to a resolution. Regardless, the installation proceeds to a successful conclusion. I guess that the missing dependency is 'rpmlib(VersionedDependencies)'.

All Red Hat 6.2 update RPMs released since 28th March 2001 are in the new 4.0.x format. These cannot be successfully installed using the Red Hat 6.2 installer. Once again packages are listed as having missing dependencies but with no suggested resolution. Even worse, packages are not correctly installed if the installer is asked to continue. Moreover, the installer builds the RPM database in the old 3.0.x format rather than the 4.0.x format using db-3.

I found this situation unsatisfactory, so I attempted to build an installation CD which would handle the new RPM format. Two possibilities presented themselves:

Upgrading the installer

Upgrading the installer to use the 4.0.x libraries doesn't seem to work. This shouldn't have been too much of a surprise, given the somewhat buggy nature of the existing Red Hat 6.2 installer. Failures seen include RPMs being installed in the wrong order and errors in running post-install scripts.

Unrelated to the RPM 3/4 issue there are some updates to the anaconda installer which you should apply. Obtain the update-disk-20001025.img image, mount it and copy the new files (apart from __init__.py) into the corresponding position in RedHat/instimage/usr/lib/anaconda on the CD. (Note that when I talk about copying files 'to the CD' I'm really referring to a directory on a hard disk where an image of the CD is being built.)

If you want to install from hard disk or across a network you'll also need to make similar changes to the RedHat/base/hdstg2.img and RedHat/base/netstg2.img image files. To perform these changes you'll need to:

Downgrading the packages

As a second attempt at cracking the problem I tried downgrading the new packages to the 3.0.x format. First I compared some old and new packages. (There are some handy utilities in the tools directory of the RPM source that help with this. You'll need to build them yourself if you want to play with them as they aren't shipped in the binary RPMs.) The main differences were:

It wasn't clear which of these was the stumbling block, so I fixed all of them. Two tools are used to make these changes, a program (rpmhack.c) and a script (rpmdown). The program, which should be compiled on a 4.0.x development system, The rpmdown script: To downgrade an RPM file use the command:
   rpmdown rpm-file
You'll need to be root to preserve the permissions, ownership and modification times of the files in the archive. The new RPM file will be called rpm-file.new. Downgrading works for both 3.0.5 packages (with 'rpmlib(VersionedDependencies)' dependencies) and 4.0.2 (post 28th March) packages. The program and script aren't general-purpose: they seem to work with the packages I've tried, but they make assumptions and may break in future.

Once the packages have been downgraded copy them to the CD and perform the various steps described in the HOWTO to build a new CD. (Update hdlist, etc.)

Conclusion

Not having the 4.0.x libraries on the install CD is unfortunate, as it means that the RPM database built during the installation is in the old format. If you've installed the 4.0.x RPM package you'll want to run 'rpm --rebuilddb' to update the format of the database.

The procedure described above seems to result in a CD which can be used to install Red Hat 6.2 with all the latest updates. At least, it seems to have worked for me, but I've only done a limited amount of testing. Caveat emptor.


Ron Yorston
18th May 2001