I am trying to set up a chroot environment with pbuilder
. I tried this but got the following issue.
$ sudo pbuilder create --distribution focal
W: /root/.pbuilderrc does not exist
I: Distribution is focal.
I: Current time: Tue Sep 8 12:15:34 IST 2020
I: pbuilder-time-stamp: 1599547534
I: Building the build environment
I: running debootstrap
/usr/sbin/debootstrap
I: Retrieving InRelease
I: Checking Release signature
E: Release signed by unknown key (key id A507B2BBA7803E3B)
The specified keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg may be incorrect or out of date.
You can find the latest Debian release key at https://ftp-master.debian.org/keys.html
E: debootstrap failed
E: Tail of debootstrap.log:
2020-09-08 12:15:35 URL:http://ppa.launchpad.net/apandada1/foliate/ubuntu/dists/focal/InRelease [17512/17512] -> "/var/cache/pbuilder/build/32477/var/lib/apt/lists/partial/ppa.launchpad.net_apandada1_foliate_ubuntu_dists_focal_InRelease" [1]
gpgv: Signature made Mon Jul 6 16:09:04 2020 IST
gpgv: using RSA key A507B2BBA7803E3B
gpgv: Can't check signature: No public key
E: End of debootstrap.log
W: Aborting with an error
I have tried importing that key with gpg --keyserver keyserver.ubuntu.com --recv-keys A507B2BBA7803E3B
, but that did not change the output of sudo pbuilder create --distribution focal
.
I have also tried this answer, but the command
sudo pbuilder --debootstrapopts --keyring=/etc/apt/trusted.gpg --distribution focal
does not help, it only outputs how to use pbuilder.
How to fix this?
I have found a workaround for this.
The added advantage of this method is that both the distribution and the architecture can be altered.