Skip to content

Instantly share code, notes, and snippets.

@liorkesos
Last active April 6, 2021 20:29
Show Gist options
  • Save liorkesos/670b3ee7dda89debd38c79abc9436825 to your computer and use it in GitHub Desktop.
Save liorkesos/670b3ee7dda89debd38c79abc9436825 to your computer and use it in GitHub Desktop.
Download apt and
#!/bin/bash
PACKAGES="ntp realmd libnss-sss libpam-sss sssd sssd-tools adcli samba-common-bin oddjob oddjob-mkhomedir packagekit"
DATEDIR=`date +%d%m%Y`
mkdir $DATEDIR
cd $DATEDIR
for pkg in $PACKAGES;
do
apt-get download $pkg;
for i in $(apt-cache depends $pkg \
| grep -E 'Depends|Recommends|Suggests' \
| cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/);
do
sudo apt-get download $i 2>>errors.txt;
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment