AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Rhel rpm11/17/2023 *) fatal "File doesn't look like rpm: $pkg" If you have tried the rpm2cpio.sh script above and it didn't work, you can save the follwing script and invoke like this: rpm2cpio.sh rpmname | cpio -idmv, it workes on my CentOS 7. # Typical usage: rpm2cpio.sh rpmname | cpio -idmvĭECOMPRESSOR="`which unlzma 2>/dev/null`"Įcho "Warning: DECOMPRESSOR not found, assuming 'cat'" 1>&2 # rpm2cpio.sh - extract 'cpio' contents of RPM I've done a few updates, particularly adding some comments and using "case" instead of stacked "if" statements, and included that fix below #!/bin/sh Simply replacing 'grep -q' with 'grep -q -i' everywhere seems to resolve the issue well. The result of the "COMPRESSION:" check is: COMPRESSION='/dev/stdin: XZ compressed data' The "DECOMPRESSION" test fails on CygWin, one of the most potentiaally useful platforms for it, due to the "grep" check for "xz" being case sensitive. * ) DECOMPRESSOR=`which lzmash 2>/dev/null` # Most versions of file don't support LZMA, therefore we assume O=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`ĬOMPRESSION=`($EXTRACTOR |file -) 2>/dev/null`Įlif echo $COMPRESSION |grep -q bzip2 thenĮlif echo $COMPRESSION |grep -iq xz then # xz and XZ safeĮlif echo $COMPRESSION |grep -q cpio then Reposted for posterity … and the next generation. That extracts the payload from a *.rpm package. For those who do not have rpm2cpio, here is the ancient rpm2cpio.sh script
0 Comments
Read More
Leave a Reply. |