Randomly I will get failures for a variety of reasons. It is not deterministic. I'm guessing the image has been configured to run a system update on startup perhaps?
----
dpkg-query: package 'binutils' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_restricted_i18n_Translation-en - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_restricted_binary-amd64_Packages - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_main_i18n_Translation-en - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_restricted_i18n_Translation-en - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_restricted_binary-amd64_Packages - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_main_i18n_Translation-en - open (2: No such file or directory)
E: Could not open file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages - open (2: No such file or directory)
----
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
----
dpkg-query: package 'binutils' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
E: Can't find a source to download version '2.30-21ubuntu1~18.04' of 'libbinutils:amd64'
E: Can't find a source to download version '2.30-21ubuntu1~18.04' of 'binutils-x86-64-linux-gnu:amd64'
E: Can't find a source to download version '2.30-21ubuntu1~18.04' of 'binutils:amd64'
I am trying to script the creation and initialisation of this VM, but these non-deterministic failures are causing me a lot of trouble.
What is happening here, and how can I mitigate against it?
TIA
Steve