Skip to content

Instantly share code, notes, and snippets.

@Sia200
Created August 23, 2021 12:10
Show Gist options
  • Save Sia200/0fe4fb40d59827a9985ceed453255708 to your computer and use it in GitHub Desktop.
Save Sia200/0fe4fb40d59827a9985ceed453255708 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Downloads .deb files of a package with the dependencies
#
# Usage Example:
#
# $ chmod +x downloaddebs.sh
# $ ./downloaddebs.sh curl
if [ $# -eq 0 ] ; then
echo "Usage: ./downloaddebs.sh <PACKAGE>"
fi
mkdir packages 2>/dev/null
cd packages
echo $1 >> packagenames.txt
for dependency in $(apt-rdepends $1 2>/dev/null | grep -v " ")
do
echo "[*] Downloading $dependency"
apt download $dependency
done
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment