Skip to content

Instantly share code, notes, and snippets.

@dlorenc
Created September 28, 2017 13:31
Show Gist options
  • Save dlorenc/7317cd794fd81cec3675f3e86d9430d5 to your computer and use it in GitHub Desktop.
Save dlorenc/7317cd794fd81cec3675f3e86d9430d5 to your computer and use it in GitHub Desktop.
pkgs="nginx apache2"
depfile=$(mktemp)
for pkg in $pkgs; do
apt-rdepends nginx --print-state | grep NotInstalled | cut -d' ' -f4 >> depfile
done
cat depfile | sort | uniq > depfile.txt
mkdir /tmp/debs
cd /tmp/debs
for i in $(cat depfile.txt); do apt-get download $i ; done
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment