Issues following apt updates/installations

Asked by John Walker

I have been attempting to build a standard environment which uses Ubuntu 14.04 along with some additional packages and have made up a quick script to update apt and install the packages I require.

If I just copy my update script into chroot (under folder /share), not change anything else and then use unetbootin to put the iso onto a flash drive, once I install onto the laptop everything works as intended. If I run my script which modifies the sources.list file, updates apt and installs a number of packages, then I start having issues.

My first issue using Ubuntu 16.04.3 was on installation I would get an error saying that grub-efi-amd64-signed was unable to be installed to /target/. Boot-repair wouldn't work to fix this issue.

I updated my original iso to Ubuntu 16.04.4 and again if I didn't make any changes it would work as intended, if I updated apt and installed the additional packages it would appear to install properly but on reboot I am taken to GNU GRUB version2.02~beta2-36ubuntu3.17 (Minimal BASH-like line editing).

As my systems will be offline, I cannot connect to the internet to download during installation and being able to use CUBIC to preinstall the additional packages is a godsend.

I am not sure if there is something I am doing wrong or if the updates being applied are breaking something in the chroot environment which is being transferred to the installed environment.

My script contains the following:

/code

#!/bin/bash

set -eu -o pipefail # fail on error, debug all lines

# update the sources.list file

cat <<EOF > /etc/apt/sources.list

# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://au.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://au.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://au.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial universe
deb http://au.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://au.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://au.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://au.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
EOF

# Update APT and upgrade all packages
apt update && apt upgrade -y

# Install pre-determined software
apt install aptitude k3b dc3dd dcfldd minicom samba virt-manager virtualbox p7zip-full p7zip-rar filezilla bless gcp tree pv grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed shim shim-signed -y

# Remove guest login
cat <<EOF > /etc/lightdm/lightdm.conf
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
allow-guest=false
EOF

# Change user libvirt-qemu (virt-manager user) show it doesn't show in greeter
usermod -u 499 libvirt-qemu

# Download aptitude packages to enable operation on generic hardware profiles
aptitude install --download-only initramfs-tools initramfs-tools-core linux-firmware linux-generic-hwe-16.04 linux-signed-image-4.10.0-40-generic init-system-helpers intltool-debian linux-base linux-headers-4.10.0-28 linux-headers-4.10.0-40 linux-headers-generic-hwe-16.04 linux-image-4.10.0-40-generic linux-image-extra-4.10.0-40-generic linux-image-generic-hwe-16.04 linux-signed-generic-hwe-16.04 linux-signed-image-4.10.0-28-generic linux-signed-image-4.10.0-40-generic linux-signed-image-generic-hwe-16.04 usb-modeswitch-data

/code

The aptitude packages are there to support various hardware profiles that this iso might be installed on.

Hoping this is something simple that I have missed or need to remove to make this work.

Thanks for all your help.

John

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
John Walker
Solved:
Last query:
Last reply:
Revision history for this message
John Walker (vampirz79) said :
#1

After removing some items from the installation (aptitude and the efi firmware) the installation has been successful.