Lubuntu の Chrome を自動更新
Chrome を apt update できるようにはしていたんですが、unattended-upgrade による自動更新がされていなくて、Lubuntu update で更新を促されていました。

自動更新については「apt upgrade の自動化」の記事を参照してください。
ぐぐったら「How can I enable silent automatic updates for Google Chrome?」というページが見つかりましたので、そのとおりやってみました。
$ sudo vi /etc/apt/apt.conf.d/51unattended-upgrades
「”Google LLC:stable”;」を加えます。
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-updates";
"${distro_id}:${distro_codename}-proposed";
"${distro_id}:${distro_codename}-backports";
"Google LLC:stable";
};
Unattended-Upgrade::Mail "root";
unattended-upgrade をドライランしてみます。
$ sudo unattended-upgrade --dry-run
/usr/bin/unattended-upgrade:567: DeprecationWarning: This process (pid=33011) is multi-threaded, use of fork() may lead to deadlocks in the child.
pid = os.fork()
/usr/bin/dpkg --status-fd 10 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/google-chrome-stable_140.0.7339.207-1_amd64.deb
/usr/bin/dpkg --status-fd 10 --configure --pending
$ less /var/log/unattended-upgrades/unattended-upgrades.log
:
2025-09-28 13:41:00,348 INFO 自動アップグレードスクリプトを開始します
2025-09-28 13:41:00,356 INFO 許可されているパッケージ導入元: 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-proposed, o=Ubuntu,a=noble-backports, o=Google LLC,a=stable
2025-09-28 13:41:00,358 INFO 初期状態のブラックリスト:
2025-09-28 13:41:00,360 INFO Initial whitelist (not strict):
2025-09-28 13:41:40,938 INFO Option --dry-run given, *not* performing real actions
2025-09-28 13:41:40,939 INFO アップグレード予定のパッケージ: google-chrome-stable
2025-09-28 13:41:40,940 INFO dpkg のログを /var/log/unattended-upgrades/unattended-upgrades-dpkg.log に書き込み中
2025-09-28 13:41:47,020 INFO すべてのアップグレードがインストールされました
2025-09-28 13:41:49,543 INFO The list of kept packages can't be calculated in dry-run mode.
以上。
で終わりにはしませんよ。Allowed-Origins に追加した「”Google LLC:stable”;」ってなによ?他のサードパーティのパッケージを追加したときは何を設定すればいいのよ?ってなりますよね。
調べました。
どのパッケージを自動アップグレードするかを指定する主な方法は、パッケージの
origin
とarchive
です。これらは、リポジトリの Release ファイルの Origin フィールドと Suite フィールドからそれぞれ取得することができます。もしくは、次のコマンドの出力の、特定のリポジトリのo
とa
フィールドで見つけることができます。Unattended upgradesのドキュメントを読む$ apt-cache policy
実行してみました。
$ apt-cache policy
パッケージファイル:
100 /var/lib/dpkg/status
release a=now
:
500 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages
release v=1.0,o=Google LLC,a=stable,n=stable,l=Google,c=main,b=amd64
origin dl.google.com
Pin されたパッケージ:
$
o が origin、a が archive ですな。
念のため、リポジトリのリリースファイルも見てみます。
$ cat /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_InRelease
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Origin: Google LLC
Label: Google
Suite: stable
Codename: stable
Version: 1.0
Date: Sat, 27 Sep 2025 09:19:36 UTC
Architectures: amd64
Components: main
Description: Google chrome-linux software repository
MD5Sum:
:
Origin が origin、Suite が archive ですな。
すっきりしました。w