Issue
I have two builds (Build1 and Build2) of the current version of an rpm package. I use 'rpm -U' (rpm upgrade) to install it.
Build1 works as expected, where the previous version is uninstalled after the new version is installed.
Build2 does not uninstall the previous version. This leaves both versions of the package on the system (Centos 7).
I am trying to find out what is causing this difference in behavior. I used the '-vv' option to output debug logs and it looks like Build2 does not even try to uninstall the previous version.
The spec file of each build is the same from what I can see and only the contents seem to differ slightly. The rpm does not have any pre, post, preun, or postun scripts.
What could be the possible causes of this behavior?
RPM log of Build1
[root@localhost ~]# rpm -Uvv --replacefiles --test TestPKG-xxx-12.8.0-0.20150810150544.Build1.i686.rpm
D: ============== TestPKG-xxx-12.8.0-0.20150810150544.Build168.i686.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm cdb:0x401
D: opening db index /var/lib/rpm/Packages 0x400 mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name 0x400 mode=0x0
D: Expected size: 49531882 = lead(96)+sigs(180)+pad(4)+data(49531602)
D: Actual size: 49531882
D: TestPKG-xxx-12.8.0-0.20150810150544.Build168.i686.rpm: Header SHA1 digest: OK (8a8ce80e01a21687044ad204eb8c716b094c8a67)
D: read h# 831 Header SHA1 digest: OK (2522c1bad2c533a5050dae7c73616694f7ef906a)
D: added binary package [0]
D: found 0 source and 1 binary packages
D: opening db index /var/lib/rpm/Conflictname 0x400 mode=0x0
D: ========== +++ TestPKG-xxx-12.8.0-0.20150810150544 i686/linux 0x1
D: opening db index /var/lib/rpm/Basenames 0x400 mode=0x0
D: read h# 119 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: /usr/bin/perl YES (db files)
D: opening db index /var/lib/rpm/Providename 0x400 mode=0x0
D: read h# 782 Header SHA1 digest: OK (42344bef7cc874fd8d6d57f1aaefb016a658e600)
D: Requires: ARandomPackage YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6 YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6(GLIBC_2.0) YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6(GLIBC_2.1) YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6(GLIBC_2.1.3) YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libm.so.6 YES (db provides)
D: read h# 663 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libm.so.6(GLIBC_2.0) YES (db provides)
D: read h# 205 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(CGI) YES (db provides)
D: read h# 237 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(DBI) YES (db provides)
D: read h# 120 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(Data::Dumper) YES (db provides)
D: read h# 778 Header SHA1 digest: OK (e43ae2964d2bdd1d6cced5d0df8e52f9cb8b63c0)
D: Requires: perl(Test::MachineType) YES (db provides)
D: Requires: perl(Test::NetworkAccessControl) YES (db provides)
D: read h# 119 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(strict) YES (db provides)
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(FileDigests) <= 4.6.0-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadIsBzip2) <= 3.0.5-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Obsoletename 0x400 mode=0x0
D: ========== --- TestPKG-xxx-12.6.0-0.1041 i686/linux 0x1
D: opening db index /var/lib/rpm/Requirename 0x400 mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, depth)
D: 0 0 0 1 +TestPKG-xxx-12.8.0-0.20150810150544.i686
D: 1 0 0 1 -TestPKG-xxx-12.6.0-0.1041.i686
D: installing binary packages
D: Selinux disabled.
D: sanity checking 2 elements
D: computing 880 file fingerprints
D: opening db index /var/lib/rpm/Group 0x400 mode=0x0
D: opening db index /var/lib/rpm/Triggername 0x400 mode=0x0
D: opening db index /var/lib/rpm/Dirnames 0x400 mode=0x0
D: opening db index /var/lib/rpm/Installtid 0x400 mode=0x0
D: opening db index /var/lib/rpm/Sigmd5 0x400 mode=0x0
D: opening db index /var/lib/rpm/Sha1header 0x400 mode=0x0
Preparing packages...
D: computing file dispositions
D: 0x00000907 4096 548211 186053 /opt/test
D: 0x00000904 4096 451768 125466 /var
D: ========== +++ TestPKG-xxx-12.8.0-0.20150810150544 i686-linux 0x1
D: Expected size: 49531882 = lead(96)+sigs(180)+pad(4)+data(49531602)
D: Actual size: 49531882
D: TestPKG-xxx-12.8.0-0.20150810150544.i686: Header SHA1 digest: OK (8a8ce80e01a21687044ad204eb8c716b094c8a67)
D: ========== +++ TestPKG-xxx-12.6.0-0.1041 i686-linux 0x1
D: closed db index /var/lib/rpm/Sha1header
D: closed db index /var/lib/rpm/Sigmd5
D: closed db index /var/lib/rpm/Installtid
D: closed db index /var/lib/rpm/Dirnames
D: closed db index /var/lib/rpm/Triggername
D: closed db index /var/lib/rpm/Obsoletename
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
D: closed db index /var/lib/rpm/Requirename
D: closed db index /var/lib/rpm/Group
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm
[root@localhost ~]#
RPM log of Build2
[root@localhost ~]# rpm -Uvv --replacefiles --test TestPKG-xxx-12.8.0-0.20150811055053.Build2.i686.rpm
D: ============== TestPKG-xxx-12.8.0-0.20150811055053.Build182.i686.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening db environment /var/lib/rpm cdb:0x401
D: opening db index /var/lib/rpm/Packages 0x400 mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name 0x400 mode=0x0
D: Expected size: 49755926 = lead(96)+sigs(180)+pad(4)+data(49755646)
D: Actual size: 49755926
D: TestPKG-xxx-12.8.0-0.20150811055053.Build182.i686.rpm: Header SHA1 digest: OK (770a488f2472bbe57ec211050d7b3bdddcdfaf73)
D: read h# 831 Header SHA1 digest: OK (2522c1bad2c533a5050dae7c73616694f7ef906a)
D: added binary package [0]
D: found 0 source and 1 binary packages
D: opening db index /var/lib/rpm/Conflictname 0x400 mode=0x0
D: ========== +++ TestPKG-xxx-12.8.0-0.20150811055053 i686/linux 0x2
D: opening db index /var/lib/rpm/Basenames 0x400 mode=0x0
D: read h# 119 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: /usr/bin/perl YES (db files)
D: opening db index /var/lib/rpm/Providename 0x400 mode=0x0
D: read h# 782 Header SHA1 digest: OK (42344bef7cc874fd8d6d57f1aaefb016a658e600)
D: Requires: ARandomPackage YES (db provides)
D: read h# 19 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6()(64bit) YES (db provides)
D: read h# 19 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6(GLIBC_2.2.5)(64bit) YES (db provides)
D: read h# 19 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libm.so.6()(64bit) YES (db provides)
D: read h# 19 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libm.so.6(GLIBC_2.2.5)(64bit) YES (db provides)
D: read h# 205 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(CGI) YES (db provides)
D: read h# 237 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(DBI) YES (db provides)
D: read h# 120 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(Data::Dumper) YES (db provides)
D: read h# 778 Header SHA1 digest: OK (e43ae2964d2bdd1d6cced5d0df8e52f9cb8b63c0)
D: Requires: perl(Test::MachineType) YES (db provides)
D: Requires: perl(Test::NetworkAccessControl) YES (db provides)
D: read h# 119 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: perl(strict) YES (db provides)
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(FileDigests) <= 4.6.0-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadIsBzip2) <= 3.0.5-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Obsoletename 0x400 mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, depth)
D: 0 0 0 1 +TestPKG-xxx-12.8.0-0.20150811055053.i686
D: installing binary packages
D: Selinux disabled.
D: sanity checking 1 elements
D: computing 464 file fingerprints
D: opening db index /var/lib/rpm/Group 0x400 mode=0x0
D: opening db index /var/lib/rpm/Requirename 0x400 mode=0x0
D: opening db index /var/lib/rpm/Triggername 0x400 mode=0x0
D: opening db index /var/lib/rpm/Dirnames 0x400 mode=0x0
D: opening db index /var/lib/rpm/Installtid 0x400 mode=0x0
D: opening db index /var/lib/rpm/Sigmd5 0x400 mode=0x0
D: opening db index /var/lib/rpm/Sha1header 0x400 mode=0x0
Preparing packages...
D: computing file dispositions
D: 0x00000907 4096 548193 186053 /opt/test
D: 0x00000904 4096 451768 125466 /var
D: ========== +++ TestPKG-xxx-12.8.0-0.20150811055053 i686-linux 0x2
D: Expected size: 49755926 = lead(96)+sigs(180)+pad(4)+data(49755646)
D: Actual size: 49755926
D: TestPKG-xxx-12.8.0-0.20150811055053.i686: Header SHA1 digest: OK (770a488f2472bbe57ec211050d7b3bdddcdfaf73)
D: closed db index /var/lib/rpm/Sha1header
D: closed db index /var/lib/rpm/Sigmd5
D: closed db index /var/lib/rpm/Installtid
D: closed db index /var/lib/rpm/Dirnames
D: closed db index /var/lib/rpm/Triggername
D: closed db index /var/lib/rpm/Obsoletename
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
D: closed db index /var/lib/rpm/Requirename
D: closed db index /var/lib/rpm/Group
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Name
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm
[root@localhost ~]#
Solution
[root@localhost ~]# rpm -Uvv --replacefiles --test TestPKG-xxx-12.8.0-0.20150811055053.Build2.i686.rpm
D: ============== TestPKG-xxx-12.8.0-0.20150811055053.Build182.i686.rpm
.... [SNIP]
D: read h# 19 Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
D: Requires: libc.so.6()(64bit)
While your second package filename is 'i686'. It is actually for x86_64 architecture according the Requires (see '(64bit)').
So rpm treat it as multilib and happily install i686 and x86_64 side by side.
Answered By - msuchy Answer Checked By - Gilberto Lyons (WPSolving Admin)