fix(ci): force all apt sources to amd64, arm64 from ports only
The sed was only modifying /etc/apt/sources.list but security.ubuntu.com and other sources in sources.list.d/ were also trying to fetch arm64 packages from repos that don't have them (404). Now: force [arch=amd64] on ALL .list files, arm64 exclusively from ports.ubuntu.com. cc
This commit is contained in:
1 file changed
+7
-7
@@ -52,13 +52,13 @@ jobs:
|
||||
- name: Install cross-compilation deps
|
||||
run: |
|
||||
sudo dpkg --add-architecture arm64
|
||||
# Use Ubuntu ports for arm64 packages
|
||||
cat <<'SOURCES' | sudo tee /etc/apt/sources.list.d/arm64.list
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main universe
|
||||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main universe
|
||||
SOURCES
|
||||
# Restrict default sources to amd64
|
||||
sudo sed -i 's/^deb http/deb [arch=amd64] http/' /etc/apt/sources.list
|
||||
# Force ALL existing sources to amd64-only (sources.list + sources.list.d/*)
|
||||
sudo sed -i 's/^deb \(http\|https\)/deb [arch=amd64] \1/' /etc/apt/sources.list
|
||||
sudo find /etc/apt/sources.list.d/ -name '*.list' -exec \
|
||||
sed -i 's/^deb \(http\|https\)/deb [arch=amd64] \1/' {} \;
|
||||
# Add arm64 sources from ports
|
||||
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main universe" | sudo tee /etc/apt/sources.list.d/arm64-ports.list
|
||||
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main universe" | sudo tee -a /etc/apt/sources.list.d/arm64-ports.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
gcc-aarch64-linux-gnu \
|
||||
|
||||
Reference in new issue
Block a user