2020-10-08 01:24:58 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e;
|
|
|
|
|
2020-10-16 09:44:26 +00:00
|
|
|
# Get latest apt-transport-https and ca-certificates for safer https apt
|
2020-10-08 01:24:58 +00:00
|
|
|
apt-get update
|
2020-10-16 09:44:26 +00:00
|
|
|
apt-get install -y apt-transport-https ca-certificates
|
|
|
|
|
|
|
|
mv /etc/apt/sources.list{.new,}
|
|
|
|
mv /etc/apt/packages.list{.new,}
|
|
|
|
apt-get update
|
|
|
|
until apt-get install --download-only --reinstall -y $(cat /etc/apt/packages.list); do
|
2020-10-08 01:24:58 +00:00
|
|
|
echo "apt install failed. Likely throttled. Retrying in 10 mins...";
|
|
|
|
sleep 600;
|
|
|
|
done;
|
|
|
|
|
2020-10-16 08:37:56 +00:00
|
|
|
(
|
|
|
|
cd /var/cache/apt/archives \
|
|
|
|
&& find . -type f \( -iname \*.deb \) -exec sha256sum {} \; \
|
|
|
|
| sed 's/.\///g' \
|
|
|
|
| LC_ALL=C sort
|
|
|
|
) > /etc/apt/package-hashes-compare.txt
|
|
|
|
|
|
|
|
diff /etc/apt/package-hashes{,-compare}.txt
|
|
|
|
|
|
|
|
apt-get install -y $(cat /etc/apt/packages.list)
|
|
|
|
|
2020-10-16 09:44:26 +00:00
|
|
|
rm -rf /var/ache/apt/archives/* /var/lib/apt/lists/* /tmp/* /var/tmp/*;
|