Rpm2cpio why we use it vs dnf for RPMs?

I like rpm2cpio because I can inspect what are the files/directories modified by the package.

And sometimes it’s best to do so because packages built for other distros may install files to non-conventional directories. For example, instead of installing libraries to /usr/lib64 or /usr/lib, it might install them to /usr/lib/x86_64. This is not critical, but it’s not elegant.

Or I can even extract the cpio, move everything in ./usr to ./usr/local, then generate the cpio and install the package. In this way, I can have control on where it’s installed.

1 Like