Skip to content

Commit 516caa5

Browse files
userFRMclaude
andcommitted
fix: restrict Ubuntu DEB822 sources to amd64 for ARM64 cross-build
Ubuntu 24.04 uses DEB822 format (.sources files), not just .list files. Without restricting Architectures in ubuntu.sources, apt tries to fetch arm64 packages from security.ubuntu.com which only serves amd64. Add Architectures: amd64 to DEB822 sources and include -security in the arm64 ports source list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a7109e8 commit 516caa5

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,19 @@ jobs:
4545
if: matrix.cross
4646
run: |
4747
sudo dpkg --add-architecture arm64
48+
# Restrict existing sources to amd64 (DEB822 .sources format on Ubuntu 24.04+)
49+
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
50+
sudo sed -i '/^Types: deb/i Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources
51+
fi
52+
# Also handle classic .list format for third-party repos
4853
sudo sed -i '/\[arch=/!s/^deb /deb [arch=amd64] /' /etc/apt/sources.list.d/*.list 2>/dev/null || true
49-
echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs) main restricted universe" | sudo tee /etc/apt/sources.list.d/arm64.list
50-
echo "deb [arch=arm64] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
54+
# Add arm64 packages from ports.ubuntu.com
55+
CODENAME=$(lsb_release -cs)
56+
cat <<SOURCES | sudo tee /etc/apt/sources.list.d/arm64-cross.list
57+
deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe
58+
deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe
59+
deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe
60+
SOURCES
5161
sudo apt-get update
5262
sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64
5363
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

0 commit comments

Comments
 (0)