Skip to content

Instantly share code, notes, and snippets.

@jlinoff
Last active March 9, 2021 14:47
Show Gist options
  • Save jlinoff/264162dc0b8632eb7b59 to your computer and use it in GitHub Desktop.
Save jlinoff/264162dc0b8632eb7b59 to your computer and use it in GitHub Desktop.
Download all RPM files from base and epel repositories.
#!/bin/bash
# Download RPM files from the base and epel repositories.
for Repo in base epel ; do
OutDir=/opt/shared/repo/$Repo
[ ! -d $OutDir ] && mkdir -p $OutDir
for RPM in $(repoquery -qa --repoid=$Repo) ; do
yum install $RPM -y --downloadonly --downloaddir=$OutDir
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment