ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have copied the binary (rpmtest) to RHEL5 x86_64 (64 bit) machine.
I executed the rpmtest binary using following command.
#./rpmtest
It works fine.
After that I executed the following command.
rpm -q rpm
The problem is here. It's giving the following errors.
rpmdb: program version 4.3 does not match environment version.
error: db4 error (30974) from dbenv -> open: DB_VERSION_MISMATCH: Database environment version mismatch.
Error: can not open packages index using db3 (30974).
error: can not open packages database in /var/lib/rpm
package rpm is not installed.
So I googled more and found workaround that removing the rpm temp files and --rebuilddb will help in this. But it did not help me.
After deleting the temp (var/lib/rpm/__db*) files, I was able to run the rpm query(rpm -q rpm) without errors and the temp files created again. But this time I was not able run my program. It was giving above mentioned errors.
If the temp files created while running the program, I am not able to run the rpm commands. If the temp files created while running the rpm command, I am not able to run my program.
If i compiled it in 64 bit machine, it's working fine.
But my requirement is that I have to compile my application in 32 bit only, becase of some other dependencies. The above code is part of my application. But application is failing with the above mentioned errors, when it's trying to call the rpmdbOpen function.
For 32 bit compilation, all the rpm libraries (.so) files linked to the /usr/lib folder. But 64 bit compilation, all the rpm libraris (.so) files linked to the /usr/lib64 folder.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.