Extract RPM content

To access the contents of a software package, extract the RPM files.

About this task

In some cases, for example, if a package required by RPM is damaged, you might need to extract the content of the package. In such cases, if an RPM installation is still working despite the damage, you can use the rpm2archive utility to convert an .rpm file to a tar archive to use the content of the package.

Note

If the RPM installation is severely damaged, you can use the rpm2cpio utility to convert the RPM package file to a cpio archive.

Procedure

Convert the RPM file to the tar archive:
$ rpm2archive <filename>.rpm

The resulting file has the .tgz suffix. For example, to create an archive from the bash package, complete the following steps:

  1. Convert the bash RPM package to the tar archive:
    $ rpm2archive bash-4.4.19-6.el8.x86_64.rpm
  2. Display the contents of the archive file:
    $ ls bash-4.4.19-6.el8.x86_64.rpm.tgz
    bash-4.4.19-6.el8.x86_64.rpm.tgz