What the heck do I do with a .cpio file?

For some unknown reason, Oracle considers it necessary to distribute their UNIX software in .cpio files. Since this is the only time I ever use cpio, I can never remember the command and I always end up looking it up.

Well, for future reference, here is how you extract a .cpio file to the current directory on most platforms:

cpio -idmv < filename_to_extract.cpio

Some platforms, like AIX, may give errors like this with these options:

cpio: 0511-903 Out of phase!
cpio attempting to continue...

cpio: 0511-904 skipping 732944 bytes to get back in phase!
One or more files lost and the previous file is possibly corrupt!

cpio: 0511-027 The file name length does not match the expected value.

If you run into these you need to add the c option as the headers are stored in ASCII. The command should now look like this:

cpio -idcmv < filename_to_extract.cpio

For more information refer to the man page for cpio, but this is all I ever do with cpio. For a better UNIX archiving utility, consider tar.

22 thoughts on “What the heck do I do with a .cpio file?”

  1. On HP-UX 11 I needed to add the -c option. I share your frustration with these cpio files.

  2. I did exactly what you said, but still can not deal with oracle cpio files.
    My OS is CentOs4.4
    Any suggestion?

  3. From my experience of moving installs around, some versions of tar don’t like working with very large tarballs. Solaris 8 was particularly bad – so I guess that’s why they don’t use it.

  4. Thanks! You betcha I was installing oracle and I was like WHAT THE HECK IS THIS!? Zip Na RAR no. Tar ball no.. Gzip Nope… Thanks for the post!

    Robert

  5. Thanks! You betcha I was installing oracle and I was like WHAT THE HECK IS THIS!? Zip Na RAR no. Tar ball no.. Gzip Nope… Thanks for the post!

    Robert

  6. Thanks for sharing this, because I thought that cpio were corrupted and was thinking downloading cpio files again.

    Just a note: I didn’t have to put extra “c” parameter on Debian/Ubuntu/Centos4/Centos5

    Regards

  7. I was railing at my teammates about Oracle and their silly cpio files – then googled – and found you expressing the exact same sentiment. Thank you so much for this command! I am running right now… 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *