mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 00:06:57 +00:00
[ubuntu] Disable automatic updates to avoid apt lock issue. (#1761)
* added shutdown-apt-service.sh script * added logging * added new status * shutdown service check * removed apy.daily from apt.sh * Another way to disable automatic updates; * fix deployment files. * enable retry logic for apt * add PowerShellGet installation before az modules * fixed a comment Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
@@ -3,11 +3,21 @@
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -yq update
|
||||
apt-get -yq dist-upgrade
|
||||
systemctl disable apt-daily.service
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# Configure apt to always assume Y
|
||||
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user