Skip to content

Instantly share code, notes, and snippets.

@matschundbrei
Last active April 2, 2019 15:50
Show Gist options
  • Save matschundbrei/3d413cea532ad32f82b4845b9c9192d2 to your computer and use it in GitHub Desktop.
Save matschundbrei/3d413cea532ad32f82b4845b9c9192d2 to your computer and use it in GitHub Desktop.
all the rpm/yum commands that I constantly fail to remember but need anytime I have to do something with rpm/yum

show me the description/details of the package

rpm -qip <yourpackage.rpm>
yum info <yourpackage>

show me what is inside the package

rpm -qlp <yourpackage.rpm>
repoquery -l <yourpackage>

the ladder needs yum-utils installed

show me which rpm creates this file

rpm -qf </path/to/your/file>
yum whatprovides </path/to/your/file>
repoquery --whatprovides </path/to/your/file>

Fun fact on yum whatprovides and repoquery --whatprovides: it works on any files within any package, not only the ones you have installed and on top of that it supports wildcards. So you can show all packages with a bundled java binary by typing: yum whatprovides */java or repoquery --whatprovides */java.

show me all available versions of a package

yum --showduplicates list <yourpackage>

show me the dependencies of a package

rpm -q --whatrequires <yourpackage>
repoquery -q --whatrequires <yourpackage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment