The log is $ rpm -qa error: db_init:db3.c:994: dbenv->open(13): Permission denied error: cannot open Packages(0) index: Permission denied(13) DB: Berkeley DB 5.1.19: (August 27, 2010) error: cannot open Packages database in /var/lib/rpm BTW: root can run the command successfully.
"opkg-cl list-installed" has the same issue for a non-root user: $ opkg-cl list-installed Collected errors: * opkg_conf_load: Could not create lock file /var/lib/opkg/lock: Permission denied.
This is to be expected, you need to be root to run package management operations.
Actually this is a bug.. but it's low. As Richard indicates you need root to use the package management system. But traditionally you can query the packages available on the system as non-root. - Mark
Most of the estimate time is required for testing the work, the change is likely fairly simple.
Running "rpm -qa" tries to create shared locks in /var/lib/rpm. So a scheme with g+w permission needs to be devised. However "rpm -qa" skips the locking with some minor risk of non-root segfaulting iof/when another rpm install (not query) process is running. However I believe that the permissions on /var/lib/rpm/Packages are preventing the open here, likely because of umask settings.
This was REOPENED
I don't see that this was reopened. We never solved the issue as it was low priority.
I would like to reassign to myself if this is still a issue.
Alex, next time you've an image with rpm on, can you verify this still happens with rpm v4?
Just tried on core-image-sato as a 'nobody' user - rpm -qa works fine.