Skip to content

Instantly share code, notes, and snippets.

@clifferson
Created April 23, 2013 02:20
Show Gist options
  • Save clifferson/5440326 to your computer and use it in GitHub Desktop.
Save clifferson/5440326 to your computer and use it in GitHub Desktop.
Find out what repo an rpm was installed from
yum-utils provides repoquery
For a single package, you can find this with
repoquery -i package
PACKAGE=ruby-enterprise
repoquery --qf "%{repoid}" $PACKAGE
Replace $PACKAGE with the name of the package you care about.
You can find all packages that came from a specific repository with
REPO=ruby-enterprise-opt
repoquery --repoid=$REPO -a --qf "%{name}" | sort > repo_packages
rpm -qa --qf "%{name}\n" | sort > installed_packages
comm -1 -2 repo_packages installed_packages
Replace $REPO with the id of the repository you care about; you can see the ids of all your enabled repositories with yum repolist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment