Score:0

apt update fails within proot

cn flag

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?

Liso avatar
sd flag
Try this, exact problem and in docker too --> https://superuser.com/a/1545323/1106777.
N0rbert avatar
zw flag
Try https://askubuntu.com/a/1082115/66509 .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.