diff --git a/usr/lib/python3.6/lxcmgr/pkgmgr.py b/usr/lib/python3.6/lxcmgr/pkgmgr.py index 47d59ba..bc17b91 100644 --- a/usr/lib/python3.6/lxcmgr/pkgmgr.py +++ b/usr/lib/python3.6/lxcmgr/pkgmgr.py @@ -251,7 +251,8 @@ class PkgMgr: image = self.installed_packages['apps'][app]['containers'][container]['image'] for layer in self.installed_packages['images'][image]['layers']: if layer in layers: - del layers[layer] + # Layer is still used, remove from set of layers to be purged + layers.remove(layer) for layer in layers: self.purge_layer(layer)