Cross-compiling for arm64 - missing aufs-tools

I am trying to make a cross-compilation for a snap, which builds just fine on x86 now. I need to get it compiling with arm64 as well, preferrably via cross-compilation.

I have docker there (older version) which needs aufs-tools.

Defines this (in snapcraft.yaml):

      - zfsutils-linux
      - aufs-tools
      - libltdl7

But fails with:

Failed to fetch stage packages: Error downloading packages for part 'docker-docker': The package 'aufs-tools' was not found..

However, for arm64 this staged package cannot be found. Anyone have any tips/tricks where to find it or how to install it?

Are you using core22 as your base? If so, aufs-tools is not available:

You could try adding a package repository, but I’m not sure if aufs-tools is going to work with the core22 base.

You may have better luck using the core20 base to support a legacy package like that.

I am using core20 as the base package.

It also seems it is not the only package missing, zfsutils-linux - same issue with that as well.

Can you post your snapcraft.yaml and error logs? I wasn’t able to reproduce it.


Thank you for showing interest @mr_cal - I can definitely share. The code is residing in GitHub:

Assuming you have docker installed:

git clone
git checkout core20
docker build --no-cache -f Dockerfile --label snapcore/snapcraft --tag ${USER}/snapcraft:core20 .
docker run --rm -v "$PWD":/build -w /build ${USER}/snapcraft:core20 bash -c "sudo apt-get update && snapcraft --target-arch=arm64 --enable-experimental-target-arch --debug"

Should show you the problem.

docker run --rm -v "$PWD":/build -w /build ${USER}/snapcraft:core20 bash -c "sudo apt-get update && snapcraft --debug"

would build it for your host machine (x64). (Actually the curl example seems to have many similar dependencies that fail in the stage-packages).

Why are we using docker? Well, it seems that snapcraft isnt’ that stable/gets messed up. It simply won’t work for me for example (Ubuntu 22.04). That (or multipass) fails by not finding the work area/directory.

jannek@jannek-P720:/work/snap-pelion-edge$ snapcraft --debug
Launching a VM.
Source path "/work/snap-pelion-edge" does not exist
An error occurred with the instance when trying to mount with 'multipass': returned exit code 1.
Ensure that 'multipass' is setup correctly and try again.

…And guessing how confined the snaps want to be, it’s likely because the multipass is limited to $HOME -folder?

Another interesting trial can be done using the curl snap package ( Try cross compiling it. By removing nearly everything from stage-packages you can get it tot the end, but it then says this:

The 'curl' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entry for this part
- libpsl5

If you do put it back in place:

Failed to fetch stage packages: Error downloading packages for part 'curl': The package 'libpsl5' was not found..

So, is it really so that the arm64 package for that just isn’t available? (Among many, many others as well).

With Ubuntu 22.04 at least on Raspberry Pi4, that package is found.

jannek@rpi4:~ $ sudo apt install libpsl5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libpsl5 is already the newest version (0.21.0-1.2).
libpsl5 set to manually installed.
The following packages were automatically installed and are no longer required:
  clang cmake cmake-data libapparmor-dev libclang-11-dev libclang-dev libcurl4-openssl-dev libdevmapper-dev libdevmapper-event1.02.1 libfuse2 libgpiod-dev libgpiod2
  libjsoncpp24 librhash0 libseccomp-dev libsystemd-dev libudev-dev libuv1-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jannek@rpi4:~ $ uname -a
Linux rpi4 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

But, I have no idea what packages snapcraft is really trying to pull and where from? Core20 is the base, so many Ubuntu 22.04 analogy is not valid.

Thanks, I was able to reproduce your issue.

Unfortunately adding arm64 stage-packages on an amd64 host is not trivial, unlike adding i386 packages on amd64 with dpkg --add-architecture i386. You may have some luck referencing the apt commands run in or here.

…And guessing how confined the snaps want to be, it’s likely because the multipass is limited to $HOME -folder?

Yes, Multipass only has access to your home directory by design. You can access /mnt and /media by connecting the interface.

Well, I tried to run snapcraft also in my home -folder but it fails also there (but just differently).

dding boot menu entry for UEFI Firmware Settings
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-148-generic
W: Couldn't identify type of root file system for fsck hook
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,704 B of archives.
After this operation, 162 kB of additional disk space will be used.
Get:1 focal-updates/universe amd64 apt-transport-https all 2.0.9 [1,704 B]
Fetched 1,704 B in 0s (11.8 kB/s)               
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package apt-transport-https.
(Reading database ... 20357 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.0.9_all.deb ...
Unpacking apt-transport-https (2.0.9) ...
Setting up apt-transport-https (2.0.9) ...
2023-04-28T23:01:37+03:00 INFO Waiting for automatic snapd restart...
snapd 2.59.1 from Canonical✓ installed
"snapd" switched to the "latest/stable" channel

core20 20230308 from Canonical✓ installed
"core20" switched to the "latest/stable" channel

snapcraft 7.3.1 from Canonical✓ installed
"snapcraft" switched to the "latest/stable/ubuntu-22.04" channel

Hit:1 focal-security InRelease                
Hit:2 focal InRelease
Hit:3 focal-updates InRelease
Reading package lists... Done
The package libdevmapper-dev has unmet dependencies: 
snapcraft-pelion-edge # 

Not very helpful, it actually does not say what is the unmet dependency.

The cross-utils seemed to also require core22 as the base. I cannot update to that, either because

  1. With Docker it just won’t work, because it requires systemd and you need to reboot after snapd installation (which can’t be done with a Dockerfile) - apparently.
  2. Local installations also fail, but again - differently.