ubuntu-defaults-image on 18.04 occured the error "/usr/bin/env: 'gpg': No such file or directory E: GPG exited with error status 127"

Asked by kznj.ubn21

** current situation
I tried to build the private iso on "ubuntu Desktop 18.04 LTS" and I have used 'ubuntu-defaults-image' of "ubuntu-defaults-builder" suite.
But it displays the message as the below and quits.

>[2019-04-15 20:21:07] lb_bootstrap
>P: Setting up cleanup function
>[2019-04-15 20:21:07] lb_bootstrap_cache restore
>P: Restoring bootstrap stage from cache...
>[2019-04-15 20:21:07] lb_bootstrap_copy
>[2019-04-15 20:21:07] lb_bootstrap_cdebootstrap
>[2019-04-15 20:21:07] lb_bootstrap_debootstrap
>          :
>[2019-04-15 20:27:42] lb_chroot_archives chroot install
>P: Configuring file /etc/apt/sources.list
>Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
>Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
>Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
>Get:4 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [296 kB]
>Get:5 http://archive.ubuntu.com/ubuntu bionic/main Translation-en [516 kB]
>Get:6 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [106 kB]
>Get:7 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [4296 B]
>Get:8 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [2192 B]
>Get:9 http://archive.ubuntu.com/ubuntu bionic/restricted Translation-en [3584 B]
>Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [574 kB]
>Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [212 kB]
>Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [6996 B]
>Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [3076 B]
>Fetched 1902 kB in 9s (218 kB/s)
>Reading package lists...
>/usr/bin/env: 'gpg': No such file or directory
>E: GPG exited with error status 127
>P: Begin unmounting filesystems...
>P: Saving caches...

** circumstances&backgound
I mean just to made the trial building therefore I use the existing any deb file in /var/cache/apt/archives as the package to be built in the iso image.
I execute 'ubuntu-defaults-image' as the below.
 bionicbeaver@BionicBeaver:~/localTemp/udb$ ./ubuntu-defaults-image --package ./deb/ubuntu-defaults-ja_18.04-0ubuntu1~ja3_all.deb

The reason why I execute the local one of 'ubuntu-defaults-image' is that I made some changes in it.
That changes is the below.
># Make sure all our dependencies (which are Recommends of our package) are
># installed. This is a bit dubious long-term, but seems to be needed to
># make autobuilds reliable.
>case $ARCH in
> *amd64|*i386)
> $SUDO apt-get -y install syslinux-themes-ubuntu syslinux-themes-ubuntu-xenial gfxboot-theme-ubuntu memtest86+ syslinux || exit 1
> #$SUDO apt-get -y install syslinux-themes-ubuntu syslinux-themes-ubuntu-$SUITE gfxboot-theme-ubuntu memtest86+ syslinux || exit 1
> ;;
>esac

'ubuntu-defaults-image' tries to install 'syslinux-themes-ubuntu' of the target release. In building the iso image of 'bionic',it tries to to install 'syslinux-themes-ubuntu-bionic'.
But 'syslinux-themes-ubuntu-bionic' does not exist according to the following description and in the fact it fails to install it.
>The Bionic Beaver (supported)
>       :
>Built packages
>syslinux-themes-ubuntu collection of boot loaders (theme metapackage)
>syslinux-themes-ubuntu-precise collection of boot loaders (ubuntu-precise theme)
>syslinux-themes-ubuntu-trusty collection of boot loaders (ubuntu-trusty theme)
>syslinux-themes-ubuntu-vivid collection of boot loaders (ubuntu-vivid theme)
>syslinux-themes-ubuntu-wily collection of boot loaders (ubuntu-wily theme)
>syslinux-themes-ubuntu-xenial collection of boot loaders (ubuntu-xenial theme)
(https://launchpad.net/ubuntu/+source/syslinux-themes-ubuntu)

And so I have changed the code of 'ubuntu-defaults-image' to fixedly install 'syslinux-themes-ubuntu-xenial'.

** verification

1) the cause of the error "/usr/bin/env: 'gpg': No such file or directory E: GPG exited with error status 127".

'ubuntu-defaults-image' tries to make the initial file system for iso image. This file system is made in the directory "./chroot" by using command 'chroot'. But 'gpg', this is the package of "gnupg" is not installed in the directory "./chroot".
'gpg' is necessary to prepare the contents of the directory "./chroot" and so in the occasion to use 'gpg',it fails.

The reason why gpg(gnupg) is not installed in the directory "./chroot" is that the package of gpg(gnupg) is "Priority: optional" in 'Bionic(18.04)' as the below.
>Package: gnupg
>Architecture: amd64
>Version: 2.2.4-1ubuntu1
>Multi-Arch: foreign
>Priority: optional   ※
>Section: utils
>Source: gnupg2
>Origin: Ubuntu
(http://archive.ubuntu.com/ubuntu/dists/bionic/main/binary-amd64/Packages.gz)

'ubuntu-defaults-image' install any packages into the directory "./chroot" using 'debootstrap'. But 'debootstrap' does install just the packages of "Priority: important" and "Priority: required". And so it does not install gpg(gnupg) of 'Priority: optional'.

On xenial(16.04) I've tried to make the iso image of "xenial". This same error of 'gpg' is not occurred.
One of reasons why the error does not occur is that the package gpg(gnupg) is "Priority: important" in xenial(16.04) as the below.
>Package: gnupg
>Priority: important  ※
>Section: utils
>Installed-Size: 1680
>Maintainer: Ubuntu Developers <email address hidden>
>Original-Maintainer: Debian GnuPG-Maintainers <email address hidden>
>Architecture: amd64
>Version: 1.4.20-1ubuntu3
(http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages.gz)

*REMARK*
I've tried to find the way to install 'gpg'(gnupg) into the directory "./chroot". Bud I did not find it.

** requested items
I would like to know "How could I resolve? Are there workarounds?".
Especiall I'd like to know the way to install 'gpg' into the directory "./chroot".

I would appreciate your guidance.

** environments
1) Base linux
Linux 4.18.0-17-generic #18~18.04.1-Ubuntu SMP Fri Mar 15 15:27:12 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

2) tools
--- ubuntu-defaults-image ---
Package: ubuntu-defaults-builder
Architecture: all
Version: 0.57
Priority: optional
Section: universe/devel
Origin: Ubuntu

--- live build suite ---
3.0~a57-1

Package: live-build
Architecture: all
Version: 3.0~a57-1ubuntu34.1
Priority: optional
Section: misc
Origin: Ubuntu

--- debootstrap ---
debootstrap 1.0.95ubuntu0.3

Package: debootstrap
Architecture: all
Version: 1.0.95ubuntu0.3
Priority: extra
Section: admin
Origin: Ubuntu

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu ubuntu-defaults-builder Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.