]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
clean up APT cache after installing packages
authorAntonio Terceiro <antonio.terceiro@linaro.org>
Tue, 11 Jun 2013 14:44:03 +0000 (11:44 -0300)
committerLars Wirzenius <liw@liw.fi>
Sun, 14 Jul 2013 16:03:28 +0000 (17:03 +0100)
This will significantly increase the compression rate of generated images

vmdebootstrap

index f857baca51ea989a09f4a0cd17114173e5d624f1..5b4fa96187affa0fef7d292718eadd2d097554a5 100755 (executable)
@@ -107,6 +107,7 @@ class VmDebootstrap(cliapp.Application):
             self.set_hostname(rootdir)
             self.create_fstab(rootdir)
             self.install_debs(rootdir)
+            self.cleanup_apt_cache(rootdir)
             self.set_root_password(rootdir)
             self.create_users(rootdir)
             self.remove_udev_persistent_rules(rootdir)
@@ -251,6 +252,10 @@ class VmDebootstrap(cliapp.Application):
         logging.debug('stdout:\n%s' % out)
         shutil.rmtree(tmp)
 
+    def cleanup_apt_cache(self, rootdir):
+        out = self.runcmd(['chroot', rootdir, 'apt-get', 'clean'])
+        logging.debug('stdout:\n%s' % out)
+
     def set_root_password(self, rootdir):
         if self.settings['root-password']:
             self.message('Setting root password')