Open4
unattended-upgrades

unattended-upgrades使おうしたけど、apt周りの知識が足りてなくて先人たちの知識が理解できなかったので整理。

「Initial whitelist (not strict):」で処理が止まってしまう。気になるのは以下ワーニング。
Could not figure out development release: Distribution data outdated. Please check for an update for distro-info-data. See /usr/share/doc/distro-info-data/README.Debian for details.
結論としては、distro-infoを更新すればよい。
sudo apt install --only-upgrade distro-info-data
自動でパッケージを実行するツールなのに、手動でパッケージアップデートしないと動かないことが気になって原因調べた。該当するコードは/usr/bin/unattended-upgradeの以下部分。
# check to see if want to auto-upgrade the devel release
if apt_pkg.config.find("Unattended-Upgrade::DevRelease") == "auto":
try:
if DISTRO_ID.lower() == 'ubuntu':
devel = (distro_info.UbuntuDistroInfo() .
devel(result="object"))
elif DISTRO_ID.lower() == 'debian':
devel = (distro_info.DebianDistroInfo() .
devel(result="object"))
else:
devel = (distro_info.DistroInfo(DISTRO_ID) .
devel(result="object"))
except Exception as e:
logging.warning("Could not figure out development release: %s" % e)
distro_infoは
「distro_info.UbuntuDistroInfo().devel(result="object")」を実行しているが、
ubuntu24.04インストール直後のdistro_info.UbuntuDistroInfo()にはdevelメソッドが存在しない。
distro-info-dataを更新すると、develが使用できるようになる。

処理が止まってしまっていたのは、security.ubuntu.comへのアクセスで500が返ってきてたから、のよう。
# unattended-upgrade --dry-run -v
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=noble, o=Ubuntu,a=noble-security, o=UbuntuESMApps,a=noble-apps-security, o=UbuntuESM,a=noble-infra-security, o=Ubuntu,a=noble-updates, o=Ubuntu,a=noble-backports
Initial blacklist:
Initial whitelist (not strict):
The URI http://security.ubuntu.com/ubuntu/pool/main/l/linux-firmware/linux-firmware_20240318.git3b128b60-0ubuntu2.17_amd64.deb failed to download, aborting
The URI http://security.ubuntu.com/ubuntu/pool/main/l/linux-firmware/linux-firmware_20240318.git3b128b60-0ubuntu2.17_amd64.deb failed to download, aborting
明日再度チャレンジ。

/etc/apt/apt.conf.d/に定義を書くが、見たことがないフォーマットだったので、記載方法を探した。