← Back to issue list

Do not run apt update in a compulsive way

View original Github issue

Metadata

Project
craft-parts
Number
#566
Type
issue
State
open
Author
sergiusens
Labels
Created
Updated
Closed

Current evaluation

craft-parts runs apt update compulsively during lifecycle, which fails in managed mode and is unnecessary in host mode. Reported 1050 days ago; code has since evolved (superuser guard, lru_cache, conditional refresh) but no maintainer has responded or labelled it.

Suggested action: needs triage

Reason: No maintainer has responded, labelled, or assigned this issue (only an auto-generated Jira-sync bot comment on 2024-05-17), so it lacks triage. The underlying behavior has partially changed since filing — refresh_packages_list is now lru_cached, guarded to superuser only (commit 425a84f1), and only invoked when install_required or for overlay packages — but the 'compulsive' refresh in the executor prologue and overlay fetch paths still exists, so it is not clearly resolved. A maintainer should confirm whether the current conditional-refresh behavior satisfies the report before deciding to keep or close.

Impact: 45 Quick Win: 20.25 Staleness: 70 Complexity: 55 Confidence: 55 Support Request: 10

Issue body

### Bug Description Apt update is always run, this makes little sense as in: - managed mode, we are provided with an updated environment - in host mode, we can update if required ### To Reproduce setup a craft project that requires apt packages ### part yaml ```shell parts: hello: plugin: autotools source: https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz ``` ### Relevant log output ```shell Initialising lifecycle :: Unknown error: Failed to refresh package list: failed to run apt update. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 20.25
Staleness: 70
Complexity: 55
Confidence: 55
Support Request: 10
needs triage craft-parts runs apt update compulsively during lifecycle, which fails in managed mode and is unnecessary in host mode. Reported 1050 days ago; code has since evolved (superuser guard, lru_cache, conditional refresh) but no maintainer has responded or labelled it.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 22.0
Staleness: 75
Complexity: 45
Confidence: 70
Support Request: 10
needs triage Maintainer-reported design concern that apt update runs unconditionally during builds. Code has since evolved to make refresh conditional (only when install required, superuser-only, LRU-cached), but issue remains open with no triage or maintainer response in 17+ months.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 25
Confidence: 85
Support Request: 10
close stale Unnecessary apt update execution causing failures in managed and host modes. Open for nearly 3 years with no maintainer response or progress.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 40
Confidence: 75
Support Request: 10
close stale Unnecessary forced apt update during lifecycle initialization causes failures. Reported by a maintainer, lacks labels, and has seen no activity or maintainer response in over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 80
Support Request: 10
needs triage Unconditional apt update during initialization is unnecessary and causes failures. Managed environments are pre-updated; host mode allows manual updates. Open with internal Jira ticket CRAFT-2942, awaiting triage and assignment. Last activity 465 days ago.

Update history

No update history recorded yet.

Related work

  • Related To: craft-parts#752 (confidence 70%)

    Commit 425a84f1 'feat(deb): only run apt update as superuser' added the euid guard in refresh_packages_list, partially addressing the 'always run' concern.

  • Related To: craft-parts#1468 (confidence 60%)

    Commit c2836c97 'fix(deb): refresh apt cache before marking packages' changed when refresh happens relative to package marking, touching the same refresh_packages_list path.

Related issues

No related issues found above the similarity threshold.