Parse an RPM name into its components

You don’t need to do any of this; RPM has a query format argument which will let you specify exactly the data you want to receive. It will even output without line endings if you don’t specify them. For instance: rpm –queryformat “%{NAME} %{VERSION} %{RELEASE} %{ARCH}” -q coreutils rpm –queryformat “The version of %{NAME} is … Read more

How do I find which rpm package supplies a file I’m looking for?

This is an old question, but the current answers are incorrect 🙂 Use yum whatprovides, with the absolute path to the file you want (which may be wildcarded). For example: yum whatprovides ‘*bin/grep’ Returns grep-2.5.1-55.el5.x86_64 : The GNU versions of grep pattern matching utilities. Repo : base Matched from: Filename : /bin/grep You may prefer … Read more