From 1ff5ba7e9e50ff1c510a5cb9cad3a26f3ff8b6ac Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 7 Mar 2020 02:12:21 +0100 Subject: [PATCH] set APT::Immediate-Configure to false in dry-run mode --- mmdebstrap | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index ce71d1c..939481a 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1224,6 +1224,14 @@ sub setup { # options. print $conf "pkgCacheGen::ForceEssential \",\";\n"; } + if ($options->{dryrun}) { + # Without this option, apt will fail with: + # E: Could not configure 'libc6:amd64'. + # E: Could not perform immediate configuration on 'libgcc1:amd64'. + # + # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953260 + print $conf "APT::Immediate-Configure false;\n"; + } close $conf; { @@ -2851,8 +2859,17 @@ sub main() { 'setup-hook=s@' => \$options->{setup_hook}, 'essential-hook=s@' => \$options->{essential_hook}, 'customize-hook=s@' => \$options->{customize_hook}, - 'simulate' => \$options->{dryrun}, - 'dry-run' => \$options->{dryrun}, + # Sometimes --simulate fails even though non-simulate succeeds because + # in simulate mode, apt cannot rely on dpkg to figure out tricky + # dependency situations and will give up instead when it cannot find + # a solution. + # + # 2020-02-06, #debian-apt on OFTC, times in UTC+1 + # 12:52 < DonKult> [...] It works in non-simulation because simulate is + # more picky. If you wanna know why simulate complains + # here prepare for long suffering in dependency hell. + 'simulate' => \$options->{dryrun}, + 'dry-run' => \$options->{dryrun}, ) or pod2usage(-exitval => 2, -verbose => 1); if (defined($logfile)) {