I’m having the same issue when trying to build a VyOS ISO image.
Steps to reproduce:
mkdir -p /var/repo/vyos
cd /var/repo/vyos
git clone -b current --single-branch https://github.com/vyos/vyos-build
cd /var/repo/vyos/vyos-build
git pull
docker run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos/vyos-build:current bash -c './build-vyos-image iso --custom-package "iperf iptraf-ng wget curl rsync bind9 ipmitool zabbix-agent php-cli bzip2 suricata suricata-update lshw sngrep" --build-by "Ivan Apolonio" --build-comment "Build Date $(date +"%Y-%m-%d")"'
And after the whole process of building the image (close to 10 minutes latter) the process stops showing the following error:
Errors were encountered while processing:
vyatta-cfg
E: Sub-process /usr/bin/dpkg returned an error code (1)
E: An unexpected failure occurred, exiting...
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
These are previous lines showing sometings about vyatta-cfg package:
...
Running in chroot, ignoring request.
All runlevel operations denied by policy
invoke-rc.d: policy-rc.d denied execution of stop.
Removing vyatta-cfg-system (0.20.44+vyos2+current22) ...
dpkg: warning: while removing vyatta-cfg-system, directory '/opt/vyatta/bin/sudo-users' not empty so not removed
...
Purging configuration files for vyatta-cfg (0.102.0+vyos2+current5) ...
Failed to disable unit, unit vyos-router.service does not exist.
dpkg: error processing package vyatta-cfg (--purge):
installed vyatta-cfg package post-removal script subprocess returned error exit status 1
...