rpm database problem

rpm database problem

Post by Uwe Grawer » Thu, 19 Jun 2003 00:47:41

hello im using the rpm4.2-devel package to get informations from
the local rpm database. i have a problem with the iterator given from
the rpm api.
my code in short terms:

#include <...> //all the headers needed

int main()
        Header h;
        rpmdb db;
        rpmdbMatchIterator dbItr;
        int count = 0;

        rpmReadConfigFiles( NULL, NULL);
        rpmdbOpen("", &db, O_READONLY, 0644);
        dbItr = rpmdbInitIterator(db, RPMTAG_NAME, NULL, 0);

        cout << "Elements: " << rpmdbGetIteratorCount(dbItr);

        while((h = rpmdbNextIterator(dbItr)) != NULL)

        cout << "Count: " << count;


my problem is that rpmdbGetIteratorCount() returns 0. but that cant be
because count have something about 500 and over. did anybody else had
this problem and can help me? thnx!!!

1. Mandrake 6.0 -- rpm database problem

How can one repair a corrupt rpm database ? Problem is if I use, e.g,
"rpm -q foo"
I got a "segmentation fault" as answer. This for all installed rpm's.
The same occurs for other rpm options like -e -v . Installing of new rpm
is also no longer possible. I've tried to reinstall (upgrade) the whole
mandrake 6.0 but the install program exit at "scanning packages" point
with a error 11. Under KDE the "package manager" simply exit if I ask to
install or delete a *.rpm file.

Thanks for any help


2. Linux to be $ued by DOJ.

3. rpm database problem

4. IDE CD ROM Configuration required for installation

5. RPM Database problem

6. dhcpd fails to update dhcpd.leases

7. rpm database problems solved

8. Problem with 3.1.2 XF86_W32 & xsetroot & 2.0.20

9. RPM database problems.

10. Recovering the /var/lib/rpm RPM database?

11. Incorporating RPM into RPM "database (depot?)"

12. RPM-database & non-rpm packages

13. Redhat 5.0 Upgrade Problem: No RPM database exists!