Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get installed packages from RPM DB #578

Closed
alonrolnik opened this issue Oct 24, 2018 · 1 comment
Closed

Get installed packages from RPM DB #578

alonrolnik opened this issue Oct 24, 2018 · 1 comment

Comments

@alonrolnik
Copy link

I'm trying to get installed packages from some Docker image and need to do it without using/install rpm. I know that today rpm store it data in /var/lib/rpm inside Berkeley DB files. When I read the Packages file I see binary data. Is it possible to extract the data in human readable format (text) straight from the DB files?

Thanks.

@ffesti
Copy link
Contributor

ffesti commented Oct 24, 2018

First: This is the issue tracker for RPM. Your problem does not qualify as a ticket here. Questions like this should go to the rpm-list mailing list or the #rpm.org IRC channel (http://rpm.org/community.html)

To your actual question: That depends a lot on what you actually mean. Many things are possible but may be not for you. The rpmdb is not meant to be read without rpm. It contains RPM headers which are binary in nature and while you could read them with other code than rpm itself - and people have done that - this is not encouraged.

You can get the names of the packages - and the names only - from the keys of /var/lib/rpm/Name.

You may want to consider to create the list of package during build time of the container as rpm should be available then - assuming you are building them yourself.

@ffesti ffesti closed this as completed Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants