From 49cc8cf32e4d77a760906f3d9dd2726101514c6d Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Wed, 19 Sep 2018 08:22:55 +0200 Subject: [PATCH] Clean lock files as well --- mmdebstrap | 6 ++++++ test.sh | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index bcb59dd..32881e7 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -853,6 +853,12 @@ sub setup { unlink "$options->{root}/var/log/apt/term.log"; unlink "$options->{root}/var/log/alternatives.log"; unlink "$options->{root}/var/cache/ldconfig/aux-cache"; + + # clean up leftover lock files + unlink "$options->{root}/var/cache/apt/archives/lock"; + unlink "$options->{root}/var/lib/apt/extended_states"; + unlink "$options->{root}/var/lib/apt/lists/lock"; + unlink "$options->{root}/var/lib/dpkg/lock-frontend"; } sub main() { diff --git a/test.sh b/test.sh index a845df3..e1ee486 100755 --- a/test.sh +++ b/test.sh @@ -106,10 +106,6 @@ for dist in stable testing unstable; do diff -u status1 status2 rm status1 status2 sudo rm debian-$dist-debootstrap/var/lib/dpkg/status debian-$dist-mm/var/lib/dpkg/status - # since we installed using apt, we have to remove some leftovers - sudo rm debian-$dist-mm/var/cache/apt/archives/lock \ - debian-$dist-mm/var/lib/apt/extended_states \ - debian-$dist-mm/var/lib/apt/lists/lock sudo rmdir debian-$dist-mm/var/lib/apt/lists/auxfiles # debootstrap exposes the hosts's kernel version sudo rm debian-$dist-debootstrap/etc/apt/apt.conf.d/01autoremove-kernels \