#1131026 mmdebstrap manpage example is wrong for aptopt Acquire::Languages (Description / Translation-en)

#1131026#5
Date:
2026-03-17 07:40:57 UTC
From:
To:
Description package fields live in e.g.
/var/lib/apt/lists/deb.debian.org_debian_dists_trixie_main_i18n_Translation-en not
/var/lib/apt/lists/deb.debian.org_debian_dists_trixie_main_binary-amd64_Packages

For speed, mmdebstrap skips Translation files by default.
If you do e.g. "apt show mg" inside mmdebstrap,
the Description is only the first line.

I have a rare case where I actually want the Translation-en downloaded:
17:41 <twb> TIR there is no way to say "is this a transition package" other than grepping for "safely remove" in Description

trying to follow the examples in the manpage is not working for me.
A minimal example is this:

    mmdebstrap stable /dev/null --aptopt='Acquire::Languages { "en"; }' --{essential,customize}-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
    [no results]

You can also try variations to look at apt's parsed config, e.g.

    mmdebstrap stable /dev/null --aptopt='Acquire::Languages { "en"; }' --{essential,customize}-hook='APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-config dump | grep Languages' --customize-hook='chroot $1 apt-config dump | grep Languages'
    Acquire::Languages "";
    Acquire::Languages:: "none";
    Acquire::Languages "";
    Acquire::Languages:: "none";
    Acquire::Languages "";
    Acquire::Languages:: "none";

I do not know if apt is trying to interact with LANGUAGE/LANG/LC_ALL (mmdebstrap sets them all to C.UTF-8 by default).
I tried tweaking those variables but it didn't help.

I do not know if apt is trying to interact with locales/locales-all/localepurge packages inside the build root.
Since those packages would only get installed after --essential-hook, I don't think that can possibly be relevant here.

Here are some additional diagnostics about my host system in case that helps somehow.

    bash5$ locale -a
    C
    C.utf8
    POSIX
    en_AU.utf8
    bash5$ locale
    LANG=en_AU.UTF-8
    LANGUAGE=
    LC_CTYPE="en_AU.UTF-8"
    LC_NUMERIC="en_AU.UTF-8"
    LC_TIME="en_AU.UTF-8"
    LC_COLLATE=C
    LC_MONETARY="en_AU.UTF-8"
    LC_MESSAGES="en_AU.UTF-8"
    LC_PAPER="en_AU.UTF-8"
    LC_NAME="en_AU.UTF-8"
    LC_ADDRESS="en_AU.UTF-8"
    LC_TELEPHONE="en_AU.UTF-8"
    LC_MEASUREMENT="en_AU.UTF-8"
    LC_IDENTIFICATION="en_AU.UTF-8"
    LC_ALL=

    bash5$ apt-config dump Acquire | grep Language
    Acquire::Languages "";
    Acquire::Languages:: "en_AU";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";
    bash5$ mmdebstrap stable /dev/null --quiet --essential-hook='apt-config dump Acquire | grep Language'  # no chroot nor APT_CONFIG -- looking at host's apt config
    Acquire::Languages "";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";
    bash5$ mmdebstrap stable /dev/null --quiet --essential-hook='env -u LC_ALL -u LANGUAGE LANG=en_AU.UTF-8 apt-config dump Acquire | grep Language'  # no chroot nor APT_CONFIG -- looking at host's apt config
    Acquire::Languages "";
    Acquire::Languages:: "en_AU";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";

What if I try using the host's Acquire::Language lines *exactly* as written?
OK that works!

    bash5$ mmdebstrap stable /dev/null --aptopt="$(apt-config dump Acquire | grep Language)" --{essential,customize}-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit' --{essential,customize}-hook='APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-config dump Acquire | grep Language' --customize-hook='chroot $1 apt-config dump Acquire | grep Language'
    I: automatically chosen mode: unshare
    I: chroot architecture amd64 is equal to the host's architecture
    I: finding correct signed-by value...
    done
    I: automatically chosen format: null
    I: using /tmp/mmdebstrap.2YRgQIDgiw as tempdir
    I: running apt-get update...
    done
    I: downloading packages with apt...
    done
    I: extracting archives...
    done
    I: installing essential packages...
    done
    I: running --essential-hook in shell: sh -c 'find $1/var/lib/apt/lists -name "*Translation*" -ls -quit' exec /tmp/mmdebstrap.2YRgQIDgiw
      5062882    472 -rw-r--r--   1 root     root       479718 Mar 13 08:00 /tmp/mmdebstrap.2YRgQIDgiw/var/lib/apt/lists/security.debian.org_debian-security_dists_stable-security_main_i18n_Translation-en
    I: running --essential-hook in shell: sh -c 'APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-config dump Acquire | grep Language' exec /tmp/mmdebstrap.2YRgQIDgiw
    Acquire::Languages "";
    Acquire::Languages:: "en_AU";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";
    I: installing remaining packages inside the chroot...
    done
    done
    I: running --customize-hook in shell: sh -c 'find $1/var/lib/apt/lists -name "*Translation*" -ls -quit' exec /tmp/mmdebstrap.2YRgQIDgiw
      5062882    472 -rw-r--r--   1 root     root       479718 Mar 13 08:00 /tmp/mmdebstrap.2YRgQIDgiw/var/lib/apt/lists/security.debian.org_debian-security_dists_stable-security_main_i18n_Translation-en
    I: running --customize-hook in shell: sh -c 'APT_CONFIG=$MMDEBSTRAP_APT_CONFIG apt-config dump Acquire | grep Language' exec /tmp/mmdebstrap.2YRgQIDgiw
    Acquire::Languages "";
    Acquire::Languages:: "en_AU";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";
    I: running --customize-hook in shell: sh -c 'chroot $1 apt-config dump Acquire | grep Language' exec /tmp/mmdebstrap.2YRgQIDgiw
    Acquire::Languages "";
    Acquire::Languages:: "en_AU";
    Acquire::Languages:: "en";
    Acquire::Languages:: "none";
    I: cleaning package lists and apt cache...
    done
    done
    I: removing tempdir /tmp/mmdebstrap.2YRgQIDgiw...
    I: success in 32.2214 seconds

Let me now go back and re-try *exactly* what the manpage told me to do...
It's not clear to me if the manpage example was "here are two different examples" or "here is one example, you need BOTH lines".
But let's try both interpretations.  Neither work.

    bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages { "environment"; "en"; }' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
    [no hits]

    bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages { "environment"; "en"; }' --aptopt='Acquire::Languages "none"' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
    [no hits]

So whatever is going on here, the manpage needs to be changed.
Maybe this is like systemd, where you have to "zero out" the variable before you add your new entries to it?
Otherwise the value set by mmdebstrap already (none) causes apt to stop looking for subsequent values?

    bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages ""; Acquire::Languages "en";' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
      5103899    472 -rw-r--r--   1 root     root       479718 Mar 13 08:00 /tmp/mmdebstrap.ML02zxB87c/var/lib/apt/lists/security.debian.org_debian-security_dists_stable-security_main_i18n_Translation-en
    bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages ""; Acquire::Languages:: "en";' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
      5117578    472 -rw-r--r--   1 root     root       479718 Mar 13 08:00 /tmp/mmdebstrap.CFVLKA_z9N/var/lib/apt/lists/security.debian.org_debian-security_dists_stable-security_main_i18n_Translation-en
    bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages:: "en";' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*" -ls -quit'
    [no hits]

#1131026#10
Date:
2026-03-17 08:30:29 UTC
From:
To:
bash5$ mmdebstrap stable /dev/null --quiet --aptopt='Acquire::Languages
"en"' --essential-hook='find $1/var/lib/apt/lists -name "*Translation*"
-print -quit'
/tmp/mmdebstrap.aJtBqVlWIx/var/lib/apt/lists/security.debian.org_debian-security_dists_stable-security_main_i18n_Translation-en

I think the longer stuff is needed if you want more than one setting at
once, e.g. environment AND en, or zh AND en.