Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Last active July 3, 2020 16:00
Show Gist options
  • Save bashkirtsevich/510fa41aed6b0b3a7bc01c95de2baed0 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/510fa41aed6b0b3a7bc01c95de2baed0 to your computer and use it in GitHub Desktop.
apt-get recursive download debs
package=$1
apt-get download $package 2>>errors.txt
depends=$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances $package | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/ -e 's/ //' | sort | uniq)
for i in $depends
do
apt-get download $i 2>>errors.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment