3

On a machine which (possibly) doesn't have access to internet I have a local rpm file. I would like to inspect it's contents, that is what files will be installed once I install it. Is it possible to do so with just dnf? With other tools?

Edit: the system does not have yum, only dnf. While I probably could add rpm for development purposes I can not assume it will always be available.

8

I would suggest rpm for this task:

rpm -qpl ./some_package.rpm

4
  • I specifically asked about dnf because as of now the system does not have rpm. – Jan Dorniak Feb 10 at 22:36
  • 1
    dnf is a front-end for rpm. You can not handle .rpm files without rpm – BulletBob Feb 10 at 22:38
  • Urgh, my bad, I'm tired and confused rpm with yum – Jan Dorniak Feb 10 at 22:40
  • Which is also a front-end for rpm – BulletBob Feb 10 at 22:41
6

You only need rpm; you can list the files shipped in an RPM with:

rpm -qlp /path/to/your.rpm

An additional -v will add file details:

rpm -qvlp /path/to/your.rpm

To see the included scripts, which may also create files:

rpm -qp --scripts /path/to/your.rpm
3
  • I specifically asked about dnf because as of now the system does not have rpm. – Jan Dorniak Feb 10 at 22:36
  • 2
    dnf needs rpm, are you sure your system doesn’t have it? – Stephen Kitt Feb 10 at 22:39
  • my bad, I'm tired and confused yum and rpm... – Jan Dorniak Feb 10 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.