Skip to content

Instantly share code, notes, and snippets.

@t3rmin4t0r
Created August 5, 2016 23:25
Show Gist options
  • Save t3rmin4t0r/a2c68f8e8136a0502c6e0701a5bd1094 to your computer and use it in GitHub Desktop.
Save t3rmin4t0r/a2c68f8e8136a0502c6e0701a5bd1094 to your computer and use it in GitHub Desktop.
Get URLs for all HDP rpms
import yum
yb = yum.YumBase()
yb.setCacheDir()
pkgs=[p for p in yb.pkgSack.returnNewestByNameArch(patterns='*.rpm') if 'HDP' in p.repoid]
for p in pkgs:
print "wget -c ", p.remote_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment