hooks/instsoft.GRMLBASE: ensure package list is up2date before trying to install...
authorMichael Prokop <mika@grml.org>
Tue, 6 Sep 2016 20:32:56 +0000 (22:32 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 6 Sep 2016 20:32:56 +0000 (22:32 +0200)
If apt's package information is out-of-date (or even empty)
then we can't install file-rc nor aptitude, so ensure
we run `apt-get update` before.

etc/grml/fai/config/hooks/instsoft.GRMLBASE

index 78a9f57..0d6cae5 100755 (executable)
@@ -55,18 +55,18 @@ EOF
      $ROOTCMD ln -s /bin/true /usr/sbin/grub-probe
    fi
 
-  # newer aptitude versions won't remove essential packages using
-  # 'aptitude -f -y install file-rc' anymore, therefore force it:
-  $ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc
+   # Update package lists (so they exist at all), so we actually can
+   # install software.
+   $ROOTCMD apt-get update
+
+   # newer aptitude versions won't remove essential packages using
+   # 'aptitude -f -y install file-rc' anymore, therefore force it:
+   $ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc
 
    if ! $ROOTCMD test -x /usr/bin/aptitude ; then
       $ROOTCMD apt-get -y install aptitude
    fi
 
-   # Update package lists (so they exist at all), so we actually can
-   # install software.
-   $ROOTCMD apt-get update
-
    # make sure we can upgrade automatically,
    # even with unsigned repos, but only if user wants it
    if [ "${FAI_ALLOW_UNSIGNED:-}" = "1" ] ; then