I'm building an image for an arm64 machine in a docker environment. I get the 20.04 base system by starting with
debootstrap --components=main --arch=arm64 --foreign focal ./mnt http://ports.ubuntu.com/ubuntu-ports
and then finish the install by entering the proot and issuing
debootstrap/debootstrap --second-stage
After that I can adapt a few more things and then successfully deploy the image. I can even install additional packages which are already on the index. The only thing that does not work is to do
apt update
within the proot. That fails with the following error message:
root@502827f30e52:/# apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_focal_InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_focal_InRelease
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/focal/InRelease Couldn't execute /usr/bin/apt-key to check /var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_focal_InRelease
W: Some index files failed to download. They have been ignored, or old ones used instead.
I checked if /usr/bin/apt-key is there and indeed, it is right where it should be and seems to be running OK. When I want to do something like apt-key list it asks me to install one of the additional packages gnupg, gnupg2 and gnupg1. If I do that it seems to run fine, so I guess this is normal behavior?
Any ideas on how I could track down why apt update/apt-key is failing?