What's blocking for cross compilation of snaps?

We have a very powerful AMD64 based server (64C/128T). However we can’t really make use of it when building our snap packages for the ARM64 platform (Raspberry Pi, Jetson Xavier NX). Currently we have settled to using Graviton2 but it’s expensive, especially when we are planning to build on snaps from a long-term perspective.

I want to know what are the main blockers in cross-compilation of snaps. Is there a roadmap that we could track or even help with to fix the cross-compilation of snaps ?

Since a much more complex project like Yocto (bitbake, etc) works quite reliabiliy with cross-compilation, which basically builds the whole OS. I am pretty sure it should be doable for snapcraft as well.

you can break that down to one word …

manpower

2 Likes

I think a good first step would be to list out a the blockers in get this to work. I presume someone would have researched this stuff a bit and when cross-compilation support was disabled in snapcraft for core20 based snaps.

Could someone from the Snapcraft team (build tool) share their views on this. cc @sergiusens

For core20 you can enable --target-arch with --enable-experimental-target-arch when using --destructive-mode.

The cross-compilation support present for core20 is meant to be very prescribed. To remove the experimental flags, we would need to document concrete examples and implement test cases to ensure coverage going forward. Not all plugins could support --target-arch, but cases would need to be created for each plugin that would.

I recently added a case just to verify the behavior of stage-packages for core20 if you want to see an example to start with:

1 Like

Hi, I am currently migrating an existing snap from core18 to core20. I have noticed that the option --target-arch seems to have no effect, at least for the autotools plugin. The application builds, but the binaries have the architecture of the host build system.

For now, I have a workaround by using the --host option as a configure parameter:

autotools-configure-parameters:
  - --host=$SNAPCRAFT_ARCH_TRIPLET

(Maybe this helps other developers as well. :slight_smile:)

I don’t know if you are aware of this specific issue?

I tried to cross-compile however I got these errors. Shouldn’t arm64 packages be attempted to be downloaded from ports.ubuntu.com instead ?

om26er@HomePC:~/scm/simplethings/st-core-services$ snapcraft --enable-experimental-target-arch --target-arch arm64 --destructive-mode
*EXPERIMENTAL* --target-arch for core20 enabled.
Setting target machine to 'arm64'
Get:1 file:/var/lib/preinstalled-pool focal InRelease                                                                                                                          
Ign file:/var/lib/preinstalled-pool focal InRelease                                                                                                                            
Get:2 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                                   
Get:3 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                                   
Hit http://packages.microsoft.com/repos/edge stable InRelease                                                                                                                  
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                                                                                        
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                                                                      
Get:6 http://archive.neon.kde.org/user focal InRelease [150 kB]                                                                                                                
Get:7 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                                                                                                                
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                                       
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Get:8 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                                    
Get:9 http://security.ubuntu.com/ubuntu focal-security/main DEP-11 48x48 Icons [11.0 kB]                                                                                       
Get:10 http://security.ubuntu.com/ubuntu focal-security/main DEP-11 64x64 Icons [21.6 kB]                                                                                      
Get:11 http://security.ubuntu.com/ubuntu focal-security/main DEP-11 64x64@2 Icons [29 B]                                                                                       
Get:12 http://security.ubuntu.com/ubuntu focal-security/main DEP-11 128x128 Icons [40.2 kB]                                                                                    
Get:13 http://security.ubuntu.com/ubuntu focal-security/main arm64 c-n-f Metadata [8116 B]                                                                                     
Get:14 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:15 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:17 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:18 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:19 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:20 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:21 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:22 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:23 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:24 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:25 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [2804 B]                                                                                     
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:35 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:36 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:37 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:38 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:39 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:40 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:41 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:42 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Get:43 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                                             
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                                         
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                                     
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Get:44 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:45 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:46 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:47 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:48 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:49 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:50 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:51 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:52 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:53 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:54 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:55 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                                       
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Get:56 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:57 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:58 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:59 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:60 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:61 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Get:62 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages [940 kB]                                                                                                     
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                                 
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                                             
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                                         
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                                     
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                                 
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                                             
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                                         
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                                     
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                                       
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                                 
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                                   
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                                             
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                                           
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                                         
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Ign http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                                   
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                                 
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Ign http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                                     
Ign http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                                   
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                                       
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                                         
Ign http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                                 
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                                 
  404  Not Found [IP: 91.189.88.142 80]                                                                                                                                        
Ign http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                                           
Ign http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                                             
Ign http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                                           
Ign http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                                   
Ign http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                                 
Fetched 642 kB in 0s (0 B/s)                                                                                                                                                   
Failed to update the package cache: Some files could not be downloaded:

W:Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'http://archive.neon.kde.org/user focal InRelease' doesn't support architecture 'arm64'
E:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.142 80]
E:Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.39 80]
E:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.142 80]
E:Some index files failed to download. They have been ignored
or old ones used instead.

Check that the sources on your host are configured correctly.

Snapcraft will not modify the sources.list configuration in destructive mode. You must add the desired repositories to your sources.list configuration.

Something like:

codename="$(lsb_release -cs)"
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports $codename main restricted universe multiverse" > /etc/apt/sources.list.d/arm64.list

Or instruct Snapcraft to do it for you with package-repositories.

Just for the sake of completeness: You could always do what https://github.com/diddlesnaps/snapcraft-multiarch-action does:

  1. Set up QEMU user mode emulation
  2. Run snapcraft inside a docker container

I’ll leave that here for anyone searching in the future.

1 Like

Still got a similar issue

om26er@HomePC:~/scm/simplethings/st-core-services$ snapcraft --enable-experimental-target-arch --target-arch arm64 --destructive-mode
*EXPERIMENTAL* --target-arch for core20 enabled.
Setting target machine to 'arm64'
Get:1 file:/var/lib/preinstalled-pool focal InRelease                                                                                                         
Ign file:/var/lib/preinstalled-pool focal InRelease                                                                                                           
Get:2 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                  
Get:3 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                  
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                                                     
Get:5 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]                                                                                           
Get:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                                                                                       
Hit http://packages.microsoft.com/repos/edge stable InRelease                                                                                                 
Get:7 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                                                                                               
Get:8 http://archive.neon.kde.org/user focal InRelease [166 kB]                                                                                               
Get:9 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 Packages [940 kB]                                                                                 
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                      
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:10 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:11 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:12 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:13 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:14 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:15 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:16 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:17 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:18 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:19 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:20 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:21 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:22 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:23 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:24 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:35 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:36 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:37 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:38 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:39 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages [871 kB]                                                                            
Get:40 http://security.ubuntu.com/ubuntu focal-security/main arm64 DEP-11 Metadata [27.6 kB]                                                                  
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:41 http://security.ubuntu.com/ubuntu focal-security/universe arm64 DEP-11 Metadata [61.2 kB]                                                              
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                        
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Get:42 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:43 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:44 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:45 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:46 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:47 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:48 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:49 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:50 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:51 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:52 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:53 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:54 http://security.ubuntu.com/ubuntu focal-security/universe arm64 c-n-f Metadata [10.4 kB]                                                               
Get:55 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Get:56 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 DEP-11 Metadata [283 kB]                                                                     
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                      
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:57 http://archive.neon.kde.org/user focal/main Sources [1085 kB]                                                                                          
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                    
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Get:58 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:59 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:60 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:61 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:62 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:63 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Get:64 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 DEP-11 Metadata [351 kB]                                                                 
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:65 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 c-n-f Metadata [16.9 kB]                                                                 
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                            
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                        
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                    
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                      
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                            
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Get:66 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 DEP-11 Metadata [489 kB]                                                                         
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                        
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Err http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:67 http://archive.neon.kde.org/user focal/main all Packages [288 kB]                                                                                      
Err http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                    
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                  
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Get:68 http://ports.ubuntu.com/ubuntu-ports focal/main DEP-11 48x48 Icons [98.4 kB]                                                                           
Get:69 http://ports.ubuntu.com/ubuntu-ports focal/main DEP-11 64x64 Icons [163 kB]                                                                            
Get:70 http://ports.ubuntu.com/ubuntu-ports focal/main DEP-11 64x64@2 Icons [15.8 kB]                                                                         
Get:71 http://ports.ubuntu.com/ubuntu-ports focal/main DEP-11 128x128 Icons [367 kB]                                                                          
Get:72 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 c-n-f Metadata [28.6 kB]                                                                         
Err http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                            
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                          
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages                                                                                        
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Err http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages                                                                                      
  404  Not Found [IP: 91.189.91.39 80]                                                                                                                        
Ign http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages                                                                                
Get:73 http://ports.ubuntu.com/ubuntu-ports focal/restricted arm64 Packages [1300 B]                                                                          
Get:74 http://ports.ubuntu.com/ubuntu-ports focal/restricted arm64 c-n-f Metadata [108 B]                                                                     
Get:75 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 Packages [8458 kB]                                                                           
Get:76 http://archive.neon.kde.org/user focal/main DEP-11 48x48 Icons [601 kB]                                                                                
Ign http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages                                                                                  
Ign http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages                                                                                    
Ign http://archive.ubuntu.com/ubuntu focal-updates/multiverse arm64 Packages                                                                                  
Err http://archive.ubuntu.com/ubuntu focal/main arm64 Packages                                                                                                
  404  Not Found [IP: 91.189.88.152 80]                                                                                                                       
Ign http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages                                                                                  
Ign http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages                                                                                          
Ign http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages                                                                                            
Ign http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages                                                                                          
Ign http://security.ubuntu.com/ubuntu focal-security/multiverse arm64 Packages                                                                                
Get:77 http://archive.neon.kde.org/user focal/main DEP-11 64x64 Icons [888 kB]                                                                                
Get:78 http://archive.neon.kde.org/user focal/main DEP-11 128x128 Icons [2100 kB]                                                                             
Get:79 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 DEP-11 Metadata [3587 kB]                                                                    
Get:80 http://ports.ubuntu.com/ubuntu-ports focal/universe DEP-11 48x48 Icons [3016 kB]                                                                       
Get:81 http://ports.ubuntu.com/ubuntu-ports focal/universe DEP-11 64x64 Icons [7794 kB]                                                                       
Get:82 http://ports.ubuntu.com/ubuntu-ports focal/universe DEP-11 64x64@2 Icons [44.3 kB]                                                                     
Get:83 http://ports.ubuntu.com/ubuntu-ports focal/universe DEP-11 128x128 Icons [14.3 MB]                                                                     
Get:84 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 c-n-f Metadata [255 kB]                                                                      
Get:85 http://ports.ubuntu.com/ubuntu-ports focal/multiverse arm64 Packages [114 kB]                                                                          
Get:86 http://ports.ubuntu.com/ubuntu-ports focal/multiverse arm64 DEP-11 Metadata [44.9 kB]                                                                  
Get:87 http://ports.ubuntu.com/ubuntu-ports focal/multiverse DEP-11 48x48 Icons [23.1 kB]                                                                     
Get:88 http://ports.ubuntu.com/ubuntu-ports focal/multiverse DEP-11 64x64 Icons [192 kB]                                                                      
Get:89 http://ports.ubuntu.com/ubuntu-ports focal/multiverse DEP-11 64x64@2 Icons [214 B]                                                                     
Get:90 http://ports.ubuntu.com/ubuntu-ports focal/multiverse DEP-11 128x128 Icons [326 kB]                                                                    
Get:91 http://ports.ubuntu.com/ubuntu-ports focal/multiverse arm64 c-n-f Metadata [8024 B]                                                                    
Fetched 46.9 MB in 6s (4138 kB/s)                                                                                                                             
Failed to update the package cache: Some files could not be downloaded:

W:Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'http://archive.neon.kde.org/user focal InRelease' doesn't support architecture 'arm64'
E:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.152 80]
E:Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.39 80]
E:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.152 80]
E:Some index files failed to download. They have been ignored
or old ones used instead.

Check that the sources on your host are configured correctly.

You’ll need to limit the arch for the archive.ubuntu.com entries in your sources.list, for example:

deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal main restricted

I believe apt assumes all enabled architectures if left unspecified, so I have my ports entries explicitly set to [arch=arm64] and archive to [arch=amd64].