Created
December 9, 2013 16:47
-
-
Save kroq-gar78/7875613 to your computer and use it in GitHub Desktop.
Get package URLs from a list of packages from a certain Ubuntu/Debian repository. Used for a manual method of apt-mirroring (apt-cacher-ng)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# retrieves all package URLs for i386 and amd64 architectures | |
PKGLIST=$1 # lists can be found at http://us.archive.ubuntu.com/ubuntu/indices/ | |
OUTFILE=$2 | |
# get all URLs for i386 | |
#for i in `cat $PKGLIST|awk '{print $1}'|sed -e 's/$/:i386/'` | |
for i in `cat $PKGLIST|awk '{print $1}'` | |
do | |
apt-cache show ${i}:i386 |grep "Filename:"|cut -f 2 -d" " | |
apt-cache show ${i}:amd64 |grep "Filename:"|cut -f 2 -d" " | |
done | uniq > $OUTFILE | |
# wget http://archive.ubuntu.com/ubuntu/$URI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment