Files
runner-images/images/linux/scripts/base/apt.sh
mikhailshaganov 72813adbe7 Rework apt-fast installation to get rid of apt repo (#3336)
* select-xamarin-sdk-v2

* Update select-xamarin-sdk-v2.sh

* change warning message

* check existed framework version

* check framework version review points

* Update apt.sh

* Update SoftwareReport.Tools.psm1

* remove a commented code

* Fixed review points

* return unattended-upgrades

* Fixed a viewing version

* add links for apt fast

* apt fast version

* apt-fast

* final check version

* add which apt-fast
2021-05-14 14:11:25 +03:00

34 lines
1.1 KiB
Bash

#!/bin/bash -e
# Stop and disable apt-daily upgrade services;
systemctl stop apt-daily.timer
systemctl disable apt-daily.timer
systemctl disable apt-daily.service
systemctl stop apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.timer
systemctl disable apt-daily-upgrade.service
# Enable retry logic for apt up to 10 times
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
# Configure apt to always assume Y
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
# Uninstall unattended-upgrades
apt-get purge unattended-upgrades
# Need to limit arch for default apt repos due to
# https://github.com/actions/virtual-environments/issues/1961
sed -i'' -E 's/^deb http:\/\/(azure.archive|security).ubuntu.com/deb [arch=amd64,i386] http:\/\/\1.ubuntu.com/' /etc/apt/sources.list
echo 'APT sources limited to the actual architectures'
cat /etc/apt/sources.list
apt-get update
# Install aria2 , jq
apt-get install aria2 jq
# 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)"