Rebuild /var/lib/dpkg/available to install not-yet-installed packages in update runs
authorMichael Prokop <mika@grml.org>
Tue, 10 Sep 2019 09:05:05 +0000 (11:05 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 10 Sep 2019 09:48:52 +0000 (11:48 +0200)
commitef74e870ca6a2b6f307d6390d7fb9f6964299551
tree0793e64b5c1d9febf54ba9dd119c569bce81d9ae
parent77f1028ad87a19481e713e36fc506fd7807a5de7
Rebuild /var/lib/dpkg/available to install not-yet-installed packages in update runs

When executing grml-live in update mode (grml-live [...] -u) using an
existing grml_chroot, then script GRMLBASE/98-clean-chroot has emptied
/var/lib/dpkg/available in a previous run already.

Executing `apt-get update` does NOT re-generate the file. This leads to
FAI's install_packages with its mkpackagelist() and clean_pkg_list()
failing to install requested packages, but reporting all packages with:

| WARNING: These unknown packages are removed from the installation list: [...]

This is unexpected, as an update run shouldn't just update existing
packages, but also try to install any additionally requested packages
from the software selection (as a package might not have been installed
due to missing dependencies, that have been taken care of in the
meanwhile).

So if we'd detect an existing /var/lib/dpkg/available that is empty,
then we would have to rebuild it using /usr/lib/dpkg/methods/apt/update.
Since /usr/lib/dpkg/methods/apt/update essentially also executes
'apt-get update' underneath, there's no need to run 'apt-get update'
only with empty /var/lib/dpkg/available, instead let's always rely on
/usr/lib/dpkg/methods/apt/update.
etc/grml/fai/config/hooks/instsoft.GRMLBASE