Reproduce for this issue is as simple as downloading -root.tar.xz (or -root.tar.gz) from http://cloud-images.ubuntu.com/daily/server/xenial , then extracting it, chrooting and apt-get installing a kernel.
I believe that amd64 works fine, so to see failure you have to either use qemu-user-static or actually run on the correct arch.
exdir=$(mktemp -d)
mkdir "$exdir"
sudo tar -C "$exdir" -xSpf xenial-server-cloudimg-arm64-root.tar.xz
# fix resolv.conf for dns to your local system's settings
sudo mv "$exdir/etc/resolv.conf" "${exdir}/etc/resolv.conf.dist"
sudo cp /etc/resolv.conf "$exdir/etc/resolv.conf"
# if cross, patch in qemu-user-static
sudo cp /usr/bin/qemu-aarch64-static "$exdir/usr/bin/"
sudo chroot "$exdir" sh -exc 'apt-get update && apt-get install -qy linux-generic'
...
Unpacking linux-generic (4.4.0.4.3) ...
Setting up linux-image-4.4.0-4-generic (4.4.0-4.19) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
/bin/cp: cannot stat ‘/boot/initrd.img-4.4.0-4-generic’: No such file or directory
Failed to copy /boot/initrd.img-4.4.0-4-generic to /boot/initrd.img at /var/lib/dpkg/info/linux-image-4.4.0-4-generic.postinst line 745.
dpkg: error processing package linux-image-4.4.0-4-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Reproduce for this issue is as simple as downloading -root.tar.xz (or -root.tar.gz) from http:// cloud-images. ubuntu. com/daily/ server/ xenial , then extracting it, chrooting and apt-get installing a kernel.
I believe that amd64 works fine, so to see failure you have to either use qemu-user-static or actually run on the correct arch.
# if running non-native arch, use qemu-user-static cloud-images. ubuntu. com/daily/ server/ xenial/ current/ xenial- server- cloudimg- arm64-root. tar.xz
sudo apt-get install -qy qemu-user-static
wget http://
exdir=$(mktemp -d) server- cloudimg- arm64-root. tar.xz
mkdir "$exdir"
sudo tar -C "$exdir" -xSpf xenial-
# fix resolv.conf for dns to your local system's settings etc/resolv. conf" "${exdir} /etc/resolv. conf.dist" etc/resolv. conf"
sudo mv "$exdir/
sudo cp /etc/resolv.conf "$exdir/
# if cross, patch in qemu-user-static qemu-aarch64- static "$exdir/usr/bin/" 4.4.0-4- generic (4.4.0-4.19) ... initrd. img-4.4. 0-4-generic’ : No such file or directory img-4.4. 0-4-generic to /boot/initrd.img at /var/lib/ dpkg/info/ linux-image- 4.4.0-4- generic. postinst line 745. 4.4.0-4- generic (--configure):
sudo cp /usr/bin/
sudo chroot "$exdir" sh -exc 'apt-get update && apt-get install -qy linux-generic'
...
Unpacking linux-generic (4.4.0.4.3) ...
Setting up linux-image-
Running depmod.
update-initramfs: deferring update (hook will be called later)
/bin/cp: cannot stat ‘/boot/
Failed to copy /boot/initrd.
dpkg: error processing package linux-image-
subprocess installed post-installation script returned error exit status 2