Automatic upgrade gives up when another program holds an apt lock
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- debian, linux, python
- 領域
- cli, operating-systems
調査の方向性
Start with system_automatic_upgrades.py, which calls mintupdate-cli upgrade --refresh-cache --yes, then the mint-refresh-cache step and the apt-get install step it runs. Reproduce by holding the apt lists lock and the dpkg frontend lock from a separate root process, as the issue describes. Done means the automatic run waits for or retries a held lock instead of giving up, and the failure is reported with a nonzero exit. Check the shutdown inhibit trade-off before choosing an approach.
索引モデルが issue の本文から書いたものです。
説明
Linux Mint 22.3, mintupdate 7.1.4, automatic upgrades enabled. Master (7.1.10) takes the same path: system_automatic_upgrades.py calls mintupdate-cli upgrade --refresh-cache --yes, which runs mint-refresh-cache and then apt-get install. One local change here: a drop-in from #1109 makes the run wait for NetworkManager before it starts.
Five of the last 25 automatic runs hit an apt lock that another program was holding, and none of them waited for it. Four times the refresh failed and the run went on with the old package lists. On 7 Nov the refresh worked but the install itself failed, because Update Manager was refreshing the cache at that moment. From /var/log/mintupdate.log:
-- Automatic Upgrade starting Sat 07 Nov 2026 00:58:19 CET:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 314411 (aptk)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
-- Automatic Upgrade starting Mon 23 Nov 2026 00:56:20 CET:
Error: mint-refresh-cache could not update the cache.
Failed to lock directory /var/lib/apt/lists/: E:Could not get lock /var/lib/apt/lists/lock. It is held by process 2200869 (apt-get)
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Who held the lock, going by the journal:
| Run | Step that failed | Held by |
|---|---|---|
| 6 Nov 15:17 | refresh (lists lock) | apt-get 245317; apt-daily.service started in the same second as the run |
| 7 Nov 00:58 | install (dpkg frontend lock) | aptk 314411, activated by mintUpdate at 00:58:42 for UpdateCache() |
| 21 Nov 13:25 | refresh (lists lock) | apt-get 1883919; apt-daily.service started in the same second |
| 22 Nov 20:56 | refresh (lists lock) | apt-get 2063055; apt-daily.service started in the same second |
| 23 Nov 00:56 | refresh (lists lock) | apt-get 2200869, which was apt-get -q=2 update from lynis.service |
All five started within two minutes of the laptop waking up, when several timers fire together.
I then held each lock for 15 seconds from a separate root process and ran the same steps by hand:
mint-refresh-cache failed after 0.5 s, exit status 0
apt-get install --assume-yes failed after 0.1 s
apt-get -o DPkg::Lock::Timeout=60 install --assume-yes waited, finished after 14.5 s
apt-get -o DPkg::Lock::Timeout=60 update failed after 1.0 s
So apt can wait for the dpkg frontend lock, but DPkg::Lock::Timeout does nothing for the lists lock (apt 2.8.4). The failed refresh also exits 0, which is #1107.
One thing that might matter for a change here. On master mintupdate-cli runs under systemd-inhibit --what=shutdown --mode=block, so any time spent waiting for a lock would also block shutdown.
I can run more tests if that helps.
- 主要言語
- Python
- スター
- 428
- フォーク
- 196
- 平均マージ
- 16時間 9分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linuxmint/mintupdate のほかの issue
-
Report failed upgrades with a non-zero exit status (mintupdate-cli, mint-refresh-cache, automatic upgrades)対応中かも @Amadeus-22 が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
linuxmint/mintupdate#1107 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
BUG
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
linuxmint/mintupdate#1089 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
flatpak-update-worker busy-loops at ~46% CPU when parent mintUpdate process exits対応中かも @dualfroz が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
linuxmint/mintupdate#1041 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
FEATURE REQUEST
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
linuxmint/mintupdate#910 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
linuxmint/mintupdate#903 ·
メンテナーはふだん 1 日以内に返信
linuxmint/mintupdate の issue をすべて見る
似ている issue
-
Task select patterns with uppercase letters never match対応中かも @manobhisriram が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
app: scripts status: backlog type: housekeeping
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
netbox-community/netbox-scripts#239 ·
メンテナーはふだん 1 日以内に返信
-
Lambda deploys fail once the bundle grows by about 254 KB対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
developmentseed/titiler-cmr#341 ·
メンテナーはふだん 1 日以内に返信
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 characters対応中かも @omkarbandikatte が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信