Reputation: 93
I'm using the following command to extract a single file from RPM package.
pm2cpio <RPM_NAME> | cpio -ivdm <FILE_NAME>
It works fine for me, but on one system (RHEL5.9), I'm getting this error:
cpio: premature end of file
I've googled it but couldn't find any appropriate answer and solution. Can someone encountered this issue and can help?
Upvotes: 2
Views: 10505
Reputation: 1232
This problem is mentioned in the Redhat Bugzilla item rpm2cpio fails on rhel-6 rpms and includes a quick fix similar to the following, which requires that the xz package is installed:
rpm2cpio foo.rpm | xzcat | cpio -idmv
Upvotes: 3
Reputation: 6748
If the RPM is from Fedora 12 or later, it probably uses a different compression. You need at least RPM v4.6 to read those RPMs, and RHEL5 only ships with 4.4.
I'm assuming your other system is Fedora 10 or above, or some other distro with RPM v4.6 or above.
Upvotes: 1