12

I have a .rpm file on my windows machine. Is there a way to inspect this file (either on windows or centos) without installing it, to find out where it was compiled from? something like metadata?

sameold
  • 963
  • 3
  • 11
  • 20

3 Answers3

16

They have lots of metadata. Use -qp to target the package file and --qf to specify which metadata you're interested in.

$ rpm -qp /var/cache/yum/x86_64/16/fedora/packages/db4-4.8.30-3.fc15.i686.rpm --qf "%{name}: %{buildhost}\n"
db4: x86-10.phx2.fedoraproject.org

rpm --querytags will show you the metadata tags.

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84
8

To check metadata on windows machine - you will need rpm utility. You can run RPM utility on Windows via Cygwin: http://cygwin.com/ - then from cygwin console you can run rpm -qip /path/file.rpm

On centos - rpm -qip /path/file.rpm

GioMac
  • 4,444
  • 3
  • 24
  • 41
5

I've forked @Ignacio answer and created oneliner to quickly go over all tags:

rpm -qp package.rpm --qf "$(rpm --querytags | sed -nr 's/(.*)/\1:%{\1}/p' | tr '[:space:]' '\n')"
alkuzad
  • 151
  • 1
  • 2