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.

2 Answers 2

9

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.
    – jaskij
    Commented Feb 10, 2021 at 22:36
  • 1
    dnf is a front-end for rpm. You can not handle .rpm files without rpm
    – BulletBob
    Commented Feb 10, 2021 at 22:38
  • Urgh, my bad, I'm tired and confused rpm with yum
    – jaskij
    Commented Feb 10, 2021 at 22:40
  • Which is also a front-end for rpm
    – BulletBob
    Commented Feb 10, 2021 at 22:41
7

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.
    – jaskij
    Commented Feb 10, 2021 at 22:36
  • 2
    dnf needs rpm, are you sure your system doesn’t have it? Commented Feb 10, 2021 at 22:39
  • my bad, I'm tired and confused yum and rpm...
    – jaskij
    Commented Feb 10, 2021 at 22:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .