I am working on a packaging and installation scheme which must support running multiple versions of the same package concurrently, mainly because a conversion from old versions to newer versions is not simple nor easily automatable, and involves risk if done carelessely (since our product may be managing terabytes of data, and any loss or corruption is a serious matter). Another issue is that for various reasons, components of our product may depend on different versions of the same rpm, and these may not always be installed in ascending order. My approach involves installing the runtime in version dependent locations, so that the rpms never overlap. The post-install scriptlets are smart enough to deal with pointing the symlinks from /usr/bin to whatever latest version of the tool to use, and the tools know how to talk to older versions of themselves - that part is not within the scope here and works (more or less). So I like rpm, especially with all the new stuff that's being implemented, but I still end up having to write a shell wrapper like the one below to deal with all circumstances and meet these specs: - installing an older version next to a newer version must work - installing the same version with a higher release number must replace the rpm with the lower release numbers (rpms of a specific version must be unique) The problems I encountered are these: - I can only use --oldpackage if there already is a version of the rpm installed. I'd prefer a way to turn off the test which ensures that I am installing a newer package and only complain if I am attempting to install the exact same version. - rpm -U removes _all_ old versions, I wished there was some type of replace option. - since I need to selectively delete and reinstall packages and cannot use -U, I am forced to use --nodeps. - due to the points above, I cannot take advantage of the "batch" install where I specify the whole transaction in a single command. Here is an extract of my installation script - comments welcome: #!/bin/sh # in the actual script, the values are computed # or specified on the command line: cli_rpm_buildnum=lms-cli-2.7-5467 cli_rpm_version=lms-cli-2.7 cli_rpm_file=RPMS/i386/lms-cli-2.7-5467.i386.rpm cli_prefix= sudo= vv=-vv if rpm --quiet -q "$cli_rpm_buildnum"; then echo "Up to date: $cli_rpm_buildnum" rpm -V $vv "$cli_rpm_buildnum" else echo Installing "$cli_rpm_version" ... for rpm in `rpm -q "$cli_rpm_version" | grep '^lms-cli' | sort -u`; do if test -n "$rpm"; then $sudo rpm -e $vv "$rpm" --nodeps --allmatches || exit 3 fi done if rpm -q lms-cli 2>/dev/null | grep -q '^lms-cli'; then $sudo rpm -i $vv $cli_prefix --oldpackage "$cli_rpm_file" || exit 3 else $sudo rpm -i $vv $cli_prefix "$cli_rpm_file" || exit 3 fi fi _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list