2020-10-24 23:30:27 +07:00
#!/bin/bash -e
2020-06-17 12:26:41 -04:00
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
# Enable retry logic for apt up to 10 times
2020-11-05 15:53:49 +03:00
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
2020-10-27 17:16:55 +07:00
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
2022-07-08 07:49:35 +02:00
# APT understands a field called Phased-Update-Percentage which can be used to control the rollout of a new version. It is an integer between 0 and 100.
# In case you have multiple systems that you want to receive the same set of updates,
# you can set APT::Machine-ID to a UUID such that they all phase the same,
# or set APT::Get::Never-Include-Phased-Updates or APT::Get::Always-Include-Phased-Updates to true such that APT will never/always consider phased updates.
# apt-cache policy pkgname
echo 'APT::Get::Always-Include-Phased-Updates "true";' > /etc/apt/apt.conf.d/99-phased-updates
2021-10-29 11:46:56 +03:00
# Fix bad proxy and http headers settings
cat <<EOF >> /etc/apt/apt.conf.d/99bad_proxy
Acquire::http::Pipeline-Depth 0;
Acquire::http::No-Cache true;
Acquire::BrokenProxy true;
EOF
2020-11-11 21:47:51 +03:00
# Uninstall unattended-upgrades
2021-01-13 04:07:02 -05:00
apt-get purge unattended-upgrades
2020-11-11 21:47:51 +03:00
2023-04-17 13:31:56 +02:00
echo 'APT sources'
2020-11-17 13:03:23 +05:00
cat /etc/apt/sources.list
2020-07-08 22:28:23 +03:00
apt-get update
2021-08-18 10:35:29 +00:00
# Install jq
apt-get install jq
2021-05-14 14:11:25 +03:00
# Install apt-fast using quick-install.sh
# https://github.com/ilikenwf/apt-fast
bash -c " $( curl -sL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh) "