Issue
I have an RPM that includes something like this in the spec:
Requires: jre >= 1.6.0
Unfortunately I have at least one system that is showing that the "db provides" JRE, even though it does not exist via the "rpm -q" command. I've tried rebuilding the DB (rpm --rebuilddb), but that didn't work.
If I do a test install on an Oracle Enterprise Linux system (OEL), i get this:
$ uname -a
Linux localhost 2.6.32-100.34.1.el6uek.i686 #1 SMP Wed May 25 17:28:36 EDT 2011 i686 i686 i386 GNU/Linux
$ rpm -qa | grep jre
$ rpm -ivv --test foo-bar-branch_bar3.4.0_40478-1.noarch.rpm 2>&1 | grep jre
D: Requires: jre >= 1.6.0 YES (db provides)
$ rpm -ivv --test foo-bar-branch_bar3.4.0_40478-1.noarch.rpm
D: ============== foo-bar-branch_bar3.4.0_40478-1.noarch.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:mpool:joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Name rdonly mode=0x0
D: read h# 399 Header sanity check: OK
D: added key gpg-pubkey-ec551f03-4c2d256a to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: Expected size: 83726244 = lead(96)+sigs(180)+pad(4)+data(83725964)
D: Actual size: 83726244
D: foo-bar-branch_bar3.4.0_40478-1.noarch.rpm: Header SHA1 digest: OK (052080492165cf509fee5304fe508aa1954d98f4)
D: ========== relocations
D: added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ foo-bar-branch_bar3.4.0_40478-1 noarch/linux 0x0
D: opening db index /var/lib/rpm/Basenames rdonly mode=0x0
D: read h# 36 Header V3 RSA/SHA256 Signature, key ID ec551f03: OK
D: Requires: /bin/bash YES (db files)
D: Requires: /bin/sh YES (db files)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: opening db index /var/lib/rpm/Providename rdonly mode=0x0
D: read h# 362 Header V3 RSA/SHA256 Signature, key ID ec551f03: OK
D: Requires: jre >= 1.6.0 YES (db provides)
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Conflictname rdonly mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D: 0 0 0 0 1 +foo-bar-branch_bar3.4.0_40478-1.noarch
D: installing binary packages
D: sanity checking 1 elements
D: computing 661 file fingerprints
Preparing packages for installation...
D: computing file dispositions
D: 0x0000fd00 4096 10118559 3213206 /
D: ========== +++ foo-bar-branch_bar3.4.0_40478-1 noarch-linux 0x0
D: Expected size: 83726244 = lead(96)+sigs(180)+pad(4)+data(83725964)
D: Actual size: 83726244
D: foo-bar-branch_bar3.4.0_40478-1.noarch: Header SHA1 digest: OK (052080492165cf509fee5304fe508aa1954d98f4)
D: install: foo-bar-branch_bar3.4.0_40478-1 has 661 files, test = 1
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
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
On a redhat(? perhaps centos) system i get this:
$uname -a
Linux arques 2.6.18-128.el5 #1 SMP Wed Dec 17 11:42:39 EST 2008 i686 athlon i386 GNU/Linux
$ rpm -qa | grep jre
$ rpm -ivv --test foo-bar-branch_bar3.4.0_40478-1.noarch.rpm 2>&1 | grep jre
D: Requires: jre >= 1.6.0 NO
D: package foo-bar-branch_bar3.4.0_40478-1.noarch has unsatisfied Requires: jre >= 1.6.0
jre >= 1.6.0 is needed by foo-bar-branch_bar3.4.0_40478-1.noarch
$ rpm -ivv --test foo-bar-branch_bar3.4.0_40478-1.noarch.rpm 2>&1
D: ============== foo-bar-branch_bar3.4.0_40478-1.noarch.rpm
D: Expected size: 83726244 = lead(96)+sigs(180)+pad(4)+data(83725964)
D: Actual size: 83726244
D: foo-bar-branch_bar3.4.0_40478-1.noarch.rpm: Header SHA1 digest: OK (052080492165cf509fee5304fe508aa1954d98f4)
D: added binary package [0]
D: found 0 source and 1 binary packages
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: ========== +++ foo-bar-branch_bar3.4.0_40478-1 noarch/linux 0x0
D: opening db index /var/lib/rpm/Depends create mode=0x0
D: opening db index /var/lib/rpm/Basenames rdonly mode=0x0
D: opening db index /var/lib/rpm/Pubkeys rdonly mode=0x0
D: read h# 46 Header V3 DSA signature: NOKEY, key ID 37017186
D: Requires: /bin/bash YES (db files)
D: read h# 46 Header V3 DSA signature: NOKEY, key ID 37017186
D: Requires: /bin/sh YES (db files)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: Requires: /bin/sh YES (cached)
D: opening db index /var/lib/rpm/Providename rdonly mode=0x0
D: Requires: jre >= 1.6.0 NO
D: package foo-bar-branch_bar3.4.0_40478-1.noarch has unsatisfied Requires: jre >= 1.6.0
D: Requires: rpmlib(CompressedFileNames) <= 3.0.4-1 YES (rpmlib provides)
D: Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1 YES (rpmlib provides)
D: opening db index /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed db index /var/lib/rpm/Pubkeys
D: closed db index /var/lib/rpm/Depends
D: closed db index /var/lib/rpm/Conflictname
D: closed db index /var/lib/rpm/Providename
D: closed db index /var/lib/rpm/Basenames
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
error: Failed dependencies:
jre >= 1.6.0 is needed by foo-bar-branch_bar3.4.0_40478-1.noarch
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D: 0 0 0 0 1 0 +foo-bar-branch_bar3.4.0_40478-1.noarch
D: May free Score board((nil))
Solution
I didn't know that another package could provide package. I figured that if that was the case then it would still appear in a "rpm -qa" listing.
$ rpm -q --whatprovides jre
java-1.6.0-openjdk-1.6.0.0-1.40.1.9.10.el6_1.i686
$ rpm -q --provides java-1.6.0-openjdk | grep jre
jre = 1.6.0
jre-1.6.0 = 1:1.6.0.0-1.40.1.9.10.el6_1
jre-1.6.0-openjdk = 1:1.6.0.0-1.40.1.9.10.el6_1
jre-openjdk = 1:1.6.0.0-1.40.1.9.10.el6_1
Answered By - mlathe