Skip to content

Instantly share code, notes, and snippets.

@leveled
Last active July 14, 2021 20:38
Show Gist options
  • Save leveled/b327b41a1a8c7f734c16806926091bbf to your computer and use it in GitHub Desktop.
Save leveled/b327b41a1a8c7f734c16806926091bbf to your computer and use it in GitHub Desktop.
RPM/yum/dnf Cheatsheet
#Extract files from an RPM
rpm2cpio ./packagecloud-test-1.1-1.x86_64.rpm | cpio -idmv
#List files in an RPM
rpm -qlpv ./packagecloud-test-1.1-1.x86_64.rpm
#List files in an installed RPM
rpm -ql packagecloud-test
#Show RPM preinstall and postinstall scripts
rpm -qp --scripts ./packagecloud-test-1.1-1.x86_64.rpm
#View contents of a repo on a remote repository
repoquery --list <packagename>
#Downloading matching files from a remote repo via DNF
sudo dnf install --downloadonly --downloaddir=. 'package-prefix*'
#Print list of files in RPM package with name as a separator
rpm --queryformat "%{NAME} %{SIZE}\n" -qlpv '../../../fb-ncipher*' | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment