• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Use rpm2cpio Command in Linux

by admin

The rpm2cpio command converts RPM files into CPIO (CPIO comes from the phrase “copy in and out”) data streams. These streams can then be piped into the cpio command, which can extrapolate the files and directories.

Example:

# ls libgcc-4.8.5-4.el7.x86_64.rpm
# rpm2cpio libgcc-4.8.5-4.el7.x86_64.rpm | cpio -idum
353 blocks
# ls
lib64 libgcc-4.8.5-4.el7.x86_64.rpm usr
# ls usr/share/doc/libgcc-4.8.5 
COPYING COPYING3 COPYING3.LIB COPYING.LIB COPYING.RUNTIME

This process is useful to extract specific files from an RPM file without having to reinstall the entire RPM. The resulting files are exactly the files that were installed; however, they are placed in the current directory.

There are no options or arguments for the rpm2cpio command.

Filed Under: Linux

Some more articles you might also be interested in …

  1. at Command Examples in Linux
  2. CentOS / RHEL : How to mount filesystems using UUID
  3. bluetoothd Command Examples in Linux
  4. “glab issue” Command Examples
  5. ipset: command not found
  6. fdp: Render an image of a force-directed network graph from a graphviz file
  7. kscreen-console Command Examples in Linux
  8. maim Command Examples in Linux
  9. Basics of Ethernet Bonding in Linux
  10. magento Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright