Query latest version of package from arbitrary RPM repository

To query a rpm repository not configured in yum (usually /etc/yum.repos.d), use repoquery

yum install repoquery

with its --repofrompath argument:

repoquery --repofrompath=foo,http://repo.url/path --repoid=foo -q package

Caveat: If you use same repoid for multiple repos, you’re gonna have a bad time!

For script usage, see repoquery fetcher in my beloved verwatch tool.