From 78b98cdab67095464122a1ff60c1438d2b78b415 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 28 Aug 2022 21:42:46 +0900 Subject: [PATCH] Update `50unattended-upgrades` and deploy --- .../files/etc/apt/apt.conf.d/50unattended-upgrades | 12 ++++++++++++ cookbooks/base/unattended-upgrade.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cookbooks/base/files/etc/apt/apt.conf.d/50unattended-upgrades b/cookbooks/base/files/etc/apt/apt.conf.d/50unattended-upgrades index d31a4d2..307996d 100644 --- a/cookbooks/base/files/etc/apt/apt.conf.d/50unattended-upgrades +++ b/cookbooks/base/files/etc/apt/apt.conf.d/50unattended-upgrades @@ -129,3 +129,15 @@ Unattended-Upgrade::Automatic-Reboot "false"; // Allow package downgrade if Pin-Priority exceeds 1000 // Unattended-Upgrade::Allow-downgrade "false"; + +// When APT fails to mark a package to be upgraded or installed try adjusting +// candidates of related packages to help APT's resolver in finding a solution +// where the package can be upgraded or installed. +// This is a workaround until APT's resolver is fixed to always find a +// solution if it exists. (See Debian bug #711128.) +// The fallback is enabled by default, except on Debian's sid release because +// uninstallable packages are frequent there. +// Disabling the fallback speeds up unattended-upgrades when there are +// uninstallable packages at the expense of rarely keeping back packages which +// could be upgraded or installed. +// Unattended-Upgrade::Allow-APT-Mark-Fallback "true"; diff --git a/cookbooks/base/unattended-upgrade.rb b/cookbooks/base/unattended-upgrade.rb index 4ab6b59..07adc5f 100644 --- a/cookbooks/base/unattended-upgrade.rb +++ b/cookbooks/base/unattended-upgrade.rb @@ -45,7 +45,7 @@ when "18.04" not_if 'test -e /var/log/cron-apt/log' end -when '20.04' +when '20.04', '22.04' %w(20auto-upgrades 50unattended-upgrades).each do |conf| remote_file "/etc/apt/apt.conf.d/#{conf}" do owner 'root'