Skip to content

Instantly share code, notes, and snippets.

@pavelanni
Created March 16, 2021 17:22
Show Gist options
  • Save pavelanni/4cc93619ed882b8f9a24ac3f06c4cb2a to your computer and use it in GitHub Desktop.
Save pavelanni/4cc93619ed882b8f9a24ac3f06c4cb2a to your computer and use it in GitHub Desktop.
You have many RPMs in one dir; you want to know which repos they belong to (BaseOS, AppStream, etc.)
for r in *rpm ; do pkgname=$(rpm -q --queryformat "%{NAME}" -p ${r}); dnf -q repoquery --qf "%{name} %{reponame}" ${pkgname} ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment