Skip to content

Instantly share code, notes, and snippets.

@dogukancagatay
Last active June 20, 2024 11:50
Show Gist options
  • Save dogukancagatay/22ea7ca1af709e73a3bd5ac746fe7880 to your computer and use it in GitHub Desktop.
Save dogukancagatay/22ea7ca1af709e73a3bd5ac746fe7880 to your computer and use it in GitHub Desktop.
Extract contents of RPM file
#!/usr/bin/env bash
# Reference: https://stackoverflow.com/questions/18787375/how-do-i-extract-the-contents-of-an-rpm
# cpio flags
# -i = extract
# -d = make directories
# -m = preserve modification time
# -v = verbose
mkdir contents; cd contents
rpm2cpio ../*.rpm | cpio -idmv
# RHEL 9
# rpm2cpio ../*.rpm | zstd -d | cpio -idmv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment