I have an rpm and I want to treat it like a tarball. I want to extract the contents into a directory so I can inspect the contents. I am familiar with the querying commands
Sometimes you can encounter an issue with intermediate RPM archive:
cpio: Malformed number
cpio: Malformed number
cpio: Malformed number
. . .
cpio: premature end of archive
That means it could be packed, these days it is LZMA2 compression as usual, by xz
:
rpm2cpio .rpm | xz -d | cpio -idmv
otherwise you could try:
rpm2cpio .rpm | lzma -d | cpio -idmv