← Back to issue list

Can't update repositories when building for different arch from host

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#2018609
Type
issue
State
closed
Author
~dilyn-corner
Labels
—
Created
Updated
Closed

Current evaluation

Cross-arch apt sources picked archive.ubuntu.com instead of ports.ubuntu.com; fixed on the snapcraft side by canonical/craft-archives#96 and snapcore/snapcraft#4303 (commit 1db0f39), released in 7.5.1/7.5.2; reporter confirmed resolved.

Resolution: closed resolved

Reason: Maintainer @mr-cal pointed to canonical/craft-archives#96 and snapcore/snapcraft#4303, shipped in snapcraft 7.5.1 (confirmed working on 7.5.2 by the reporter, who later cited commit 1db0f397b49c95800ac606a9f06b2179170fcd51). The upstream Launchpad/dpkg side of the bug (dpkg --add-architecture breaking apt update) remained open separately.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Rnning `snapcraft --use-lxd --build-for=arm64` fails at the package repository update step. Currently (snapcraft rev. 9121) `dpkg` will be used to add a new architecture (when building either in destructive mode or in LXD). For whatever reason, when `apt update` is run the incorrect URL is used for the new architecture (it points to archive.ubuntu.com instead of ports.ubuntu.com). A simple resolution I've found is making the deb sources in `/etc/apt/sources.list` more explicit by adding `[arch=amd64]` to each line. Considering snapcraft already modifies the image by running updates and adding foreign architectures, it seems reasonable to at least make the repositories the image uses a bit more explicit architecture-wise. The particular lines in question where I think this happens: https://github.com/canonical/craft-archives/blob/cc4a9346eee627948d76ade16041f96b4ad70ff1/craft_archives/repo/apt_sources_manager.py#L220-L224

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Cross-arch apt sources picked archive.ubuntu.com instead of ports.ubuntu.com; fixed on the snapcraft side by canonical/craft-archives#96 and snapcore/snapcraft#4303 (commit 1db0f39), released in 7.5.1/7.5.2; reporter confirmed resolved.
stealth/space-bunny-alpha — closed resolved Fixed by canonical/craft-archives#96 (commit 06b1ca2), which added explicit arch qualifiers to generated apt sources and only adds compatible target architectures; pulled in via snapcore/snapcraft#4303 (commit 1db0f397), shipped in snapcraft 7.5.1.
stealth/space-bunny-alpha — closed stale Cross-architecture apt source selection failed for ARM64 builds, but matching Launchpad bug #2018609 was closed without a documented fix or linked resolution.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The cross-architecture apt repository URL mismatch in snapcraft was not fixed, indicating the report was abandoned or superseded by upstream changes.
qwen/qwen3.6-35b-a3b — — Cross-architecture repository update bug in snapcraft was closed without discussion or a fix. The report appears abandoned, with no resolution or pull request provided.
qwen/qwen3.6-35b-a3b — — Closed without resolution. Cross-architecture builds failed during apt updates due to incorrect Ubuntu archive URLs. The issue was abandoned without a fix or merge.
qwen3.6-35b-a3b-mtp-q6 — — Cross-architecture apt update failures during snapcraft builds were closed without resolution. The proposed sources.list architecture tagging fix was not implemented, leaving the bug abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/craft-archives#96 (confidence 95%)

    craft-archives PR cited by the maintainer as the core fix making apt sources list architecture explicitly

  • Likely Fixed By: snapcore/snapcraft#4303 (confidence 95%)

    snapcraft-side change by tigarmo paired with craft-archives#96; released in 7.5.1

  • Duplicate Of: snapcraft (launchpad)#2009278 (confidence 85%)

    Bug 2009278 was identified by the maintainer and reporter as the same root cause (issue1 reported there)

  • Related To: snapcore/snapcraft@1db0f397b49c95800ac606a9f06b2179170fcd51 (confidence 80%)

    Commit cited by the reporter as the full resolution

Related issues

Issue Project State Summary Similarity
#2009278 Can't mix ports.ubuntu.com and archive.ubuntu.com (building multi-arch snaps) snapcraft (launchpad) closed Resolved in Snapcraft 7.5.2 by globally adding only compatible foreign architectures (amd64+i386, arm64+armhf); the reporter confirmed package-repository refresh now works.
82%
#6326 core26: apt update fails due to armhf being added to the architectures list on arm64 platforms snapcraft closed core26 arm64 builds failed because craft-archives auto-added armhf, 404ing on archive.ubuntu.com. Root cause fixed in craft-archives#255 (commit b4767b8, v2.2.2); snapcraft pinned craft-archives>=2.2.2 via merged PR #6415.
74%
#4224 Regression: snapcraft started failing with craft_archives.repo.errors.AptGPGKeyInstallError snapcraft closed Multi-key APT GPG parsing regression was fixed by merged PR #4253 (a311e7c), updating craft-archives and shipping in the Snapcraft 7.4.4 hotfix.
71%