fix(deb): reject local .deb built for an incompatible architecture - #2118
Open
SzymonPaczos wants to merge 1 commit into
Open
fix(deb): reject local .deb built for an incompatible architecture#2118SzymonPaczos wants to merge 1 commit into
SzymonPaczos wants to merge 1 commit into
Conversation
Opening a local .deb built for a foreign CPU architecture left App Center on an indefinite spinner: the PackageKit transaction failed but the error was never surfaced to the user. Validate the package architecture in LocalDebModel.build() before starting an install transaction, and show a dedicated error screen when the system's CPU cannot execute the package's architecture. The architecture comes from PackageKit's GetDetailsLocal; the compatibility check uses a static CPU-capability table so it works inside the strictly-confined snap, where dpkg cannot be executed. Related: ubuntu#1485, ubuntu#1679
SzymonPaczos
force-pushed
the
fix/local-deb-architecture-check
branch
from
May 22, 2026 19:19
79b9872 to
1b2a4d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local
.debfiles for a foreign CPU architecture (e.g. an amd64 .deb openedon arm64) leave the install button on an indefinite spinner: PackageKit fails
internally, but the error is only logged. The
errorStreamlistener instore_app.dartonly handlesSnapdException, andactiveTransactionIdisnever cleared after
waitTransactionthrows.This PR validates the package architecture in
LocalDebModel.build()beforeany
InstallFilescall and shows a dedicated error screen.PackageKit.GetDetailsLocal(works inthe snap sandbox, where
dpkg-debsubprocess is denied by the profile,verified at runtime)
(amd64 → {amd64, i386}, arm64 → {arm64, armhf, armel}, ...) so the check
works identically inside and outside the snap.
dpkg --print-foreign-architecturesis denied in the snap too, which would otherwise falsely block legitimate
multiarch installs (e.g. an i386 .deb on amd64 with multiarch enabled).
left to PackageKit, mirroring the SNAP_ARCH-first pattern from fix(packagekit): check arch compatibility in resolve #1486.
Known limitation: an i386 .deb on amd64 with multiarch not enabled is still
allowed through (same behaviour as today; detecting it would need
snap-sandbox access to multiarch config).
Tested locally on arm64;
flutter testpasses.Related: #1485 (repo-resolve variant, fixed in #1486), #1679, #1681. cc @d-loose