Facebook Twitter Instagram
    WiredRevolution.com
    • Home
    • About
    • Contact Us
    • Essential Linux Commands
    • Sitemap
    Facebook Twitter Instagram
    WiredRevolution.com
    red hat

    Extract the contents of an RPM package

    RyanBy RyanOctober 10, 2010Updated:October 10, 20101 Min Read
    Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Email

    Strangely enough there is no way to directly extract the contents of an .rpm package using the rpm (RPM Package Manager) tool. This feature can come in handy for example if you need to access a single file in a package but you don’t want to install it on your system. Fortunately there is a simple hack that you can use to make this work.

    To do this use the rpm2cpio tool to convert an .rpm file to a cpio archive then pipe it to cpio command to extract it.

    Here is an example:
    $ rpm2cpio rpm-package.rpm | cpio -idmv

    The options explained:
    i – Extract the archive
    d – Create leading directories where needed
    m – Retain previous file modification times when creating files
    v – List the files processed, be verbose

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Email
    Previous ArticleConvert a relative path to absolute path in BASH
    Next Article How to release the Linux disk cache

    Related Posts

    Install FFmpeg on RHEL 5 or CentOS 5

    Install git on SUSE 11

    How to get Boxee to correctly identify local media files

    Most Commented
    March 12, 2009

    Fix blue tinted video in Ubuntu

    September 10, 2010

    Setup SSH access between VirtualBox Host and Guest VMs

    March 8, 2011

    Install GNOME Shell in Ubuntu 10.10 Maverick

    April 4, 2009

    Setup the PS3 Bluetooth Controller on Ubuntu

    October 22, 2008

    How to correctly use LD_LIBRARY_PATH

    Recent Comments
    • Execute command on linux virtual machine (or server) from windows commandline on Setup SSH access between VirtualBox Host and Guest VMs
    • Solved: How to SSH to a VirtualBox guest externally through a host? - Daily Developer Blog on Setup SSH access between VirtualBox Host and Guest VMs
    • How to SSH to a VirtualBox guest externally through a host? [closed] – Code D3 on Setup SSH access between VirtualBox Host and Guest VMs
    • How to copy and paste from VirtualBox? [duplicate] on Setup SSH access between VirtualBox Host and Guest VMs
    • Jackie Laguna on Fix OpenGL: ChoosePixelFormat SketchUp error in WINE
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.