Skip to content

Instantly share code, notes, and snippets.

@stovak
Created March 29, 2013 18:47
Show Gist options
  • Save stovak/5272769 to your computer and use it in GitHub Desktop.
Save stovak/5272769 to your computer and use it in GitHub Desktop.
download the latest release RPM certs to a new install of red hat
#!/bin/sh
cd /tmp
curl http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/repodata/primary.sqlite.bz2 | bzip2 -dc > primary.sqlite
sqlite3 ./primary.sqlite "select url,location_href from packages where name like '%release%' order by name;"
## to do Take product of the third operation and replace "|" (pipe) with "/stable/Redhat/6/x86_64/" and pipe the result to:
# rpm -ivh $1
@ossobuffo
Copy link

!/bin/sh

cd /tmp
curl -O http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/repodata/primary.sqlite.bz2
bunzip2 primary.sqlite.bz2
sqlite3 ./primary.sqlite "SELECT url, location_href FROM packages WHERE name LIKE '%release%' ORDER BY name;" > release_urls
for line in cat release_urls; do
full_url=echo $line | sed -e 's:|:/stable/Redhat/6/x86_64/:g'
rpm -ivh $full_url
done
rm release_urls
rm primary.sqlite

@stovak
Copy link
Author

stovak commented Mar 29, 2013

cd /tmp
curl http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/repodata/primary.sqlite.bz2 | bzip2 -dc > primary.sqlite
for line in $(sqlite3 ./primary.sqlite "select url,location_href from packages where name like '%release%' order by name;"); do
rpm -iuvh echo $line | sed -e 's:|:/stable/Redhat/6/x86_64/:g'
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment