Ubuntu Jammy(在 WSL 中):新增 armhf 架構,找不到軟體包或儲存庫

Ubuntu Jammy(在 WSL 中):新增 armhf 架構,找不到軟體包或儲存庫

我正在嘗試使用 WSL 在 Windows PC 上為 armhf 交叉編譯 c++ 程式。

我已經保存了幾年前在 Debian 映像上執行此操作的方法,現在我需要在新 PC 上再次執行此操作。由於 powershell 命令wsl.exe --install會自動安裝 Ubuntu Jammy,所以我可以保留它。

我想做的下一步是新增 armhf 架構 ( sudo dpkg --add-architecture armhf),但我收到很多類似以下的錯誤:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/main/binary-armhf/Packages  404  Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/binary-armhf/Packages  404  Not Found [IP: 185.125.190.39 80] 
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/main/binary-armhf/Packages  404  Not Found [IP: 185.125.190.39 80] 
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.82 80] 
E: Some index files failed to download. They have been ignored, or old ones used instead.

我查看了這些 URL,發現binary-armhf其中都不存在該目錄。

顯然,我無法 apt 安裝libgtk-3-dev:armhf軟體包或 arm gcc 編譯器。

我並不是真正的 Linux 專家;我知道我可能需要將存儲庫添加到列表中,但我無法找到它們的位置。

有人可以告訴我應該如何使用 Windows 應用程式商店提供的 Ubuntu Jammy 映像來建立 armhf 的 WSL 嗎?

答案1

你的最終的sources.list應該是這樣的:

deb [ arch=amd64,i386 ] http://archive.ubuntu.com/ jammy main restricted universe multiverse
deb [ arch=amd64,i386 ] http://archive.ubuntu.com/ jammy-updates main restricted universe multiverse
deb [ arch=amd64,i386 ] http://archive.ubuntu.com/ jammy-security main restricted universe multiverse
deb [ arch=amd64,i386 ] http://archive.ubuntu.com/ jammy-backports main restricted universe multiverse

deb [ arch=armhf ] http://ports.ubuntu.com/ jammy main restricted universe multiverse
deb [ arch=armhf ] http://ports.ubuntu.com/ jammy-updates main restricted universe multiverse
deb [ arch=armhf ] http://ports.ubuntu.com/ jammy-security main restricted universe multiverse
deb [ arch=armhf ] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse

(加上deb-src我為簡潔起見而省略的行)

為了清楚起見,我建議將存儲庫armhf放在..list/etc/apt/sources.list.d

相關內容