How do I extract the contents of an rpm?

前端 未结 14 1895

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

14条回答
  •  轮回少年
    2020-12-12 10:22

    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
    

提交回复
热议问题