I'm trying to use WSL to cross-compile a c++ program for armhf on a Windows PC.
I've saved how i was able to do it on a Debian image some years ago, and now i need to do it again on a new PC. Since the powershell command wsl.exe --install
automagically installed Ubuntu Jammy, i'm fine at keeping it.
The next steps I want to do is to add the armhf architecture (sudo dpkg --add-architecture armhf
) but i get a lot of errors like these ones:
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.
I've looked at those URLs and the directory binary-armhf
does'nt exists in any of them.
Obviously, then i can't apt -install the libgtk-3-dev:armhf
packages, and the arm gcc compiler as well.
I'm not really expert in linux, i understand that i may need to add repositories to the list, but i'm unable to find where they are.
Could someone tell me what should i do to build for armhf using the Ubuntu Jammy image available from the Windows Store for WSL?
Best Answer
Your final sources.list should look something like:
(Plus the
deb-src
lines which I omitted for brevity)Just for the sake of clarity, I'd suggest putting the
armhf
repos in a separate.list
file in/etc/apt/sources.list.d
.