Update errors on Ubuntu desktop after installing cross toolchain

Hello,

After installing cross toolchain the following error occur upon desktop system update:

E: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/bionic/main/binary-armhf/Packages 404 Not Found [IP: 194.158.119.186 80]
E: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/binary-armhf/Packages 404 Not Found [IP: 2001:860:f70a::2 80]
E: Failed to fetch http://fr.archive.ubuntu.com/ubuntu/dists/bionic-backports/main/binary-armhf/Packages 404 Not Found [IP: 2001:860:f70a::2 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/main/binary-armhf/Packages 404 Not Found [IP: 2001:67c:1562::15 80]

Where is the problem ?

Thanks.

That server doesn’t host armhf packages, what directions are you following?

Regards,

Sorry, I’m afraid I didn’t understand what you mean saying “what directions”.
Perhaps should I add another repository ?
Sincerely

Sorry, I'm afraid I didn't understand what you mean saying "what
directions".

  What book or web-site are you reading for the instructions on how to
set up the cross-build environment?

Perhaps should I add another repository ?

  Lots...

For cross compiling on the Beaglebone from Ubuntu, this might be helpful:
https://www.itdev.co.uk/blog/building-linux-kernel-cross-compiling-beaglebone-black

As Robert mentioned, if you go to the link in your error message, you’ll see there are no ARM packages:
http://fr.archive.ubuntu.com/ubuntu/dists/bionic/main/

Neither does the non “.fr” link:
http://archive.ubuntu.com/ubuntu/dists/bionic/main/

Cheers,

Jon

With ubuntu, all the ports are on "http://ports.ubuntu.com/"

But if you use debian, everything's setup for cross builds, just apt
update/ apt install..

So why ubuntu?

Hence what guide are you following..

Regards,

From what I remember with Debian, you still need to add the arm arch to add cross build support:

sudo dpkg --add-architecture armhf
[https://wiki.debian.org/CrossCompiling](https://wiki.debian.org/CrossCompiling)


Ubuntu seems to be more widely used on PCs so there seems to be more examples. No other reason for me.
Personally, I just like to download the toolchain and reference it from the folder location.

Cheers,
Jon



Sorry, I’m afraid I didn’t understand what you mean saying “what
directions”.

What book or web-site are you reading for the instructions on how to
set up the cross-build environment?

Exploring BeagleBone, 2nd Ed. I followed instructions from the book.

Perhaps should I add another repository ?

Lots…
https://gist.github.com/josephlr/5034c933bbcfddc25a9275037821b048

But how to know which of them have binary-armhf/Packages

For cross compiling on the Beaglebone from Ubuntu, this might be helpful:
https://www.itdev.co.uk/blog/building-linux-kernel-cross-compiling-beaglebone-black

Hmm … Here they advice to cross-compile the kernel. But at my Ubuntu cross-compilation works fine. The only problem - when I try to update my Ubuntu, there are errors, related to armhf.

As Robert mentioned, if you go to the link in your error message, you’ll see there are no ARM packages:
http://fr.archive.ubuntu.com/ubuntu/dists/bionic/main/

So the question is what repository should I add to get arm pkgs.

With ubuntu, all the ports are on “http://ports.ubuntu.com/

But if you use debian, everything’s setup for cross builds, just apt
update/ apt install…

So why ubuntu?

Because my Linux machine is Ubuntu machine.

Hence what guide are you following…

Exploring BeagleBone, 2nd Ed.

All Derek's examples assume Debian 9, running on x86_64, see
"Recommended.png" screen shot..

By using Ubuntu, you are really on your own, as the book assumes
Debian for setting up the environment...

Regards,

Recommended.png

All Derek’s examples assume Debian 9, running on x86_64, see
“Recommended.png” screen shot…

By using Ubuntu, you are really on your own, as the book assumes
Debian for setting up the environment…

Well … I was aware of it. I thought using Ubuntu won’t create a lot of problems.
If my understanding is correct, the solution to the problem is to add a “good” Ubuntu repository (i.e. a repository that contains the arm staff). Correct?

When you set-up the repos, did you set the architecture on your Ubuntu system to ARM?
You can check it via:
dpkg --print-architecture
or
dpkg-architecture -qDEB_HOST_ARCH

Did you perhaps set the foreign architecture on your host to ARM?
You can check it via:
dpkg --print-foreign-architectures

You could install something like VirtualBox on your Ubuntu system and then download a Debian image and work from there if you have too much of an issue using Ubuntu.
https://www.virtualbox.org/wiki/Linux_Downloads

Jon

You should be able to get rid of those messages by running the following:
sudo dpkg --remove-architecture armhf

Some options to run with the extended cross-compiling options are:

  1. Run through the debootstrap option from the book.
    or
  2. Download the ARM toolchain for the BB manually and just reference it in your code or IDE.
    This is what I use: gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf toolchain from:
    https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/
    or
  3. Install the build tools on the BB and copy the BB arm-linux-gnueabihf from /usr/bin, /usr/include, usr/lib, and /lib to the host system via rsync and reference this from your IDE:
    RasPi Example:
    https://medium.com/@zw3rk/making-a-raspbian-cross-compilation-sdk-830fe56d75ba
    or
  4. Go the Debian VM or Install option.

Jon

From what I've read, Ubuntu tries to be the more "user-friendly"
/desktop/ environment, having more bleeding-edge updates -- while it is
based off of Debian, Debian may take more time to incorporate and release
significant changes.

https://linuxconfig.org/debian-vs-ubuntu

  Unless one is running an X desktop environment, the stability of Debian
is probably to be preferred for embedded systems.

You add all of the armhf specific repositories. Then run

apt update

to fetch the listing of the contents.

apt search <whatever>

to find candidate packages. I can't really help beyond that -- my desktop
machine runs W10, and I have Debian Buster in a VirtualBox environment, so
the book procedure was pretty much exact (allowing for the fact that the
book uses Debian 9 [or even 8] rather than 10).

Debian might be the preferred OS for Debian based embedded systems, but in my world Red Hat is the Linux OS of choice.

If you are cross compiling, it really should not make a diff what the host OS is. I can do this on Windows 10. In this case, Debian just makes it easier since you can install the toolchain directly via apt. If one uses something like Ubuntu, it’s just a bit more work but not impossible.

Jon

Part of what Derek was showing in his book, it was a library
"matching" cross compiling..

As long as your running Debian 9.x on the Beagle, and Debian 9.x on
your x86 host, you can install the gcc Debian cross tools and build
against your "armhf" libraries on x86, and your application will have
the exact same library build version on the ARM Beagle..

Regards,

Or just rsync the libraries and includes from the BB or download the toolchain and libraries manually to the host and reference that.

The section in question from Derek’s book is in reference to Cross-Compilation with Third-Party Libraries (Multiarch). This is one way to do that but not 100% necessary. Again, it;s just the easier way and perhaps best approach in this instance.

He does mention Ubuntu in the description though so that could be confusing for some.

However, this is your realm so I will step back from this.

Cheers,

Jon

Debian might be the preferred OS for Debian based embedded systems, but in my world Red Hat is the Linux OS of choice.

If you are cross compiling, it really should not make a diff what the host OS is. I can do this on Windows 10. In this case, Debian just makes it easier since you can install the toolchain directly via apt. If one uses something like Ubuntu, it’s just a bit more work but not impossible.

Jon

Yes, I also agree with that. That’s why I want to continue with Ubuntu (at least give it a few tries).
I added the repositories from the link Robert provided in one of previous messages:
sources.list

Unfortunately it didn’t help.

Concerning your propositions from previous mail (i.e. options 1 … 4) I just remark that cross toolchain works fine: I can build applications and then run them on BBB.
The problem is mostly related to Ubuntu. But maybe it’s not too serious.