Skip to content

Instantly share code, notes, and snippets.

@spectra
Created December 8, 2015 19:21
Show Gist options
  • Save spectra/0b6dece31462f5fc2e87 to your computer and use it in GitHub Desktop.
Save spectra/0b6dece31462f5fc2e87 to your computer and use it in GitHub Desktop.
Parallel downloading for apt-get
#!/bin/bash
NBATCH=3
NPARALLEL=5
(apt-get -y --print-uris $@ | egrep -o -e "http://[^\']+" | xargs -r -l${NBATCH} -P${NPARALLEL} wget -nv -P "/var/cache/apt/archives/") && apt-get $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment