From 48e34852a2d78d506f9521ff90899773546b5946 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 23 Feb 2019 13:22:44 +0100 Subject: [PATCH] clean /var/lib/apt/lists/auxfiles so that apt older than 1.6 has no problem with the chroot --- coverage.sh | 1 + mmdebstrap | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/coverage.sh b/coverage.sh index 53931ff..a7c1994 100755 --- a/coverage.sh +++ b/coverage.sh @@ -155,6 +155,7 @@ grep -v '^Priority: ' /tmp/debian-$dist-mm/var/lib/dpkg/status > status2 diff -u status1 status2 rm status1 status2 rm /tmp/debian-$dist-debootstrap/var/lib/dpkg/status /tmp/debian-$dist-mm/var/lib/dpkg/status +# this file is only created by apt 1.6 or newer rmdir /tmp/debian-$dist-mm/var/lib/apt/lists/auxfiles # debootstrap exposes the hosts's kernel version rm /tmp/debian-$dist-debootstrap/etc/apt/apt.conf.d/01autoremove-kernels \ diff --git a/mmdebstrap b/mmdebstrap index e40e0c8..d8c7210 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1641,6 +1641,11 @@ sub setup { # clean up temporary configuration file unlink "$options->{root}/etc/apt/apt.conf.d/00mmdebstrap" or error "failed to unlink /etc/apt/apt.conf.d/00mmdebstrap: $!"; + # apt since 1.6 creates the auxfiles directory. If apt inside the chroot + # is older than that, then it will not know how to clean it. + if (-e "$options->{root}/var/lib/apt/lists/auxfiles") { + rmdir "$options->{root}/var/lib/apt/lists/auxfiles" or die "cannot rmdir /var/lib/apt/lists/auxfiles: $!"; + } info "cleaning package lists and apt cache..."; run_apt_progress({