Hi,

Quoting Benjamin Drung (2020-01-06 11:17:46)
> The bug is that some files in /var/lib/apt/lists/ remain. Example:
> 
> $ mmdebstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg \
>   -v --component=main \
>   --setup-hook="echo \"deb http://deb.debian.org/debian buster contrib\" > 
> \"\$1/etc/apt/sources.list.d/example.list\"" \
>   buster /tmp/buster.tar.xz
> $ tar -tf /tmp/buster.tar.xz | grep '/var/lib/apt/lists'
> ./var/lib/apt/lists/
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_InRelease
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_binary-amd64_Packages
> ./var/lib/apt/lists/deb.debian.org_debian_dists_buster_contrib_i18n_Translation-en
> ./var/lib/apt/lists/lock
> ./var/lib/apt/lists/partial/
> 
> I expect that these deb.debian.org_debian_dists_buster_* files in
> /var/lib/apt/lists/ are removed.

I agree. You again found a nice corner-case bug. Thanks! :)

The problem here is, that you place stuff into /etc/apt/sources.list.d/. When
cleaning, mmdebstrap passes /dev/null to apt instead of /etc/apt/sources.list,
so that apt will remove everything in /var/lib/apt/lists/ that was before
downloaded due to the content in /etc/apt/sources.list. But mmdebstrap does
*not* overwrite the /etc/apt/sources.list.d/ directory and hence apt will still
keep all the Packages files associated with these lists. That's the effect you
are seeing here. Apt indeed does clean everything except the "buster_contrib"
lists that come from /etc/apt/sources.list.d/. Gladly the fix is simple.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to