Comment 7 for bug 1310076

Revision history for this message
Nobuto Murata (nobuto) wrote :

The reason auto-installation lts-saucy does not work in my environment was that the result of "in_chroot(['apt-cache', 'search', package], capture=True)" was empty. i.e. "apt-cache search linux-generic-lts-saucy" returns empty result.

To put `apt-get update` before the line works for me as a workaround (apt-get update runs twice before and after `apt-cache search`).

I'm not sure this is a issue in curtin or in maas tarball image.

--- /usr/lib/python2.7/dist-packages/curtin/commands/curthooks.py.orig 2014-04-21 03:02:52.271682540 +0900
+++ /usr/lib/python2.7/dist-packages/curtin/commands/curthooks.py 2014-04-21 03:32:08.754944407 +0900
@@ -170,6 +170,8 @@

         package = "linux-{flavor}{map_suffix}".format(
             flavor=flavor, map_suffix=map_suffix)
+ # make sure package cache is updated
+ in_chroot(['apt-get', 'update', '--quiet'])
         out, _ = in_chroot(['apt-cache', 'search', package], capture=True)
         if (len(out.strip()) > 0 and
                 not util.has_pkg_installed(package, target)):