2020-10-24 23:30:27 +07:00
|
|
|
#!/bin/bash -e
|
2020-06-17 12:26:41 -04:00
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2020-07-08 22:28:23 +03:00
|
|
|
apt-get -yq update
|
|
|
|
|
apt-get -yq dist-upgrade
|
2020-10-27 17:16:55 +07:00
|
|
|
|
|
|
|
|
# Stop and disable apt-daily upgrade services;
|
|
|
|
|
systemctl stop apt-daily.timer
|
2020-06-17 12:26:41 -04:00
|
|
|
systemctl disable apt-daily.timer
|
2020-10-27 17:16:55 +07:00
|
|
|
systemctl disable apt-daily.service
|
|
|
|
|
systemctl stop apt-daily-upgrade.timer
|
2020-06-17 12:26:41 -04:00
|
|
|
systemctl disable apt-daily-upgrade.timer
|
|
|
|
|
systemctl disable apt-daily-upgrade.service
|
2020-07-08 22:28:23 +03:00
|
|
|
|
2020-10-27 17:16:55 +07:00
|
|
|
# This step should completely disable any automatic updates except manual
|
|
|
|
|
sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades
|
|
|
|
|
|
|
|
|
|
# Enable retry logic for apt up to 10 times
|
|
|
|
|
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
|
|
|
|
|
|
2020-07-08 22:28:23 +03:00
|
|
|
# Configure apt to always assume Y
|
|
|
|
|
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
|
|
|
|
|
|
2020-09-08 14:40:56 +03:00
|
|
|
# Install aria2 and jq
|
2020-07-08 22:28:23 +03:00
|
|
|
apt-get install aria2
|
2020-09-08 14:40:56 +03:00
|
|
|
apt-get install jq
|
|
|
|
|
# Use apt-fast for parallel downloads
|
2020-07-08 22:28:23 +03:00
|
|
|
add-apt-repository -y ppa:apt-fast/stable
|
|
|
|
|
apt-get update
|
2020-09-08 14:40:56 +03:00
|
|
|
apt-get install apt-fast
|