Created
August 23, 2021 12:10
-
-
Save Sia200/0fe4fb40d59827a9985ceed453255708 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/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