There is a .spec file to build an rpm package for our software. In the %pre section of the .spec file there is a check if a previous major version of our software is installed. If yes, the installation is aborted with a nice error message. In the former RHEL versions everything did work fine. In RHEL 6.7 (and seems like also in RHEL 6.5) the rpm installer does not reach (or ignore?) the %pre section and complains that file ... from install of our-software-server-23.01-1.el6.i386 conflicts with file from package our-software-server-22.07-1.el6.i386 and then the installation aborts. And there are tons of such files. And this is exactly the case that our %pre section in the .spec file was taking care about.What has been changed in the rpm handling between the recent releases? I found nothing so far. rpm --version shows 4.8.0Any help is much appreciated!%pre serverif [ $1 -gt 1 ]; then# Check for an unsupported major version upgradeINSTALLED_VER=$(rpm -q our-software-server|sed -e 's/our-software-server-\([0-9]\+\).*/\1/')echo Upgrade check:echo installed  : $INSTALLED_VERecho new version: %{majorver}if [ $INSTALLED_VER -ne %{majorver} ]; then    echo    echo ERROR:    echo An automatic RPM upgrade across major versions is not supported!    echo Please refer to the Upgrade Notes on how to manually perform    echo an upgrade and migrate the configuration data.    echo    exit 1fi...
%pre section of my.rpm is no longer executed on RHEL 6.7
rhel;rpm;rpmbuild
rpm-4.8.0 has added a global file lock in /var/lib/rpm/.rpm.lock thatprevents an rpm install from recursing by invoking rpm in %post.See    why can't I install packages with rpm? I get transaction lockMeanwhile there is very little need to have/use a global interprocess lock:rpm (and processes that depend on rpmlib like yum) hardly ever contend fora global lock.Short answer: Rename the lock file before attempting rpm -q in %post, andrestore the file before exiting %post. The lock race window opened byrenaming the global lock file is vanishingly small in practice.Note that using dependencies, rather than invoking rpm in %pre, is a far bettersolution than what you are attempting.