Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 215646

Summary: app-arch/rpm-4.4.6-r4 failed rebuilding database /var/lib/rpm/Packages
Product: Gentoo Linux Reporter: Martin von Gagern <Martin.vGagern>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED INVALID    
Severity: normal CC: sochotnicky
Priority: High    
Version: 2007.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Martin von Gagern 2008-03-31 21:22:59 UTC
# emerge -1 =rpm-4.4.6-r4
...
>>> Original instance of package unmerged safely.
 * RPM database found... Rebuilding database (may take a while)...
rpmdb: /var/lib/rpm/Packages: unexpected file type or format
error: cannot open Packages index using db3 - Invalid argument (22)
 * Byte compiling python modules for python-2.5 .. ...                                                                                                 [ ok ]
...
# file /var/lib/rpm/Packages
/var/lib/rpm/Packages: Berkeley DB (Btree, version 9, native byte-order)

I've noticed this error message quite by accident, as I had to remerge rpm due to an update of neon. Examining logs from previous runs, I can tell this happened before. Looks like I had rpm-5.0_beta4 installed before it got masked due to bug 205280, and this error happened ever since. So it might be the format created by rpm-5 is incompatible with rpm-4. However, I'd expect an ewarn in this case, so I know about the problem.

Personally, I have no rpm-managed packages installed, so I can simply delete the database and run rpm --initdb. However, I could imagine that the consequences might be more severe for other users. I have no clue how much the formats differ, if there is any chance to convert the format, or if you should suggest users to unmask rpm-5 if they have any rpm packages installed.
Comment 1 Stanislav Ochotnicky (RETIRED) gentoo-dev 2010-04-22 18:54:07 UTC
rpm-4* and rpm-5* are nowadays completely different packages (as far as their source code goes). As such database format is not compatible (which you correctly guessed). 

I am closing this bug as INVALID because rpm-4 and rpm-5 are really not compatible and rpm-5* is hard-masked in portage. Therefore to trigger this bug you would have unmask the package yourself. Breakages are to be expected then.

If you feel this is incorrect, feel free to re-open the bug.